1 # SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)
4 $id: http://kernel.org/schemas/netlink/netlink-raw.yaml#
5 $schema: https://json-schema.org/draft-07/schema
13 type: [ string, integer ]
14 pattern: ^[0-9A-Za-z_]+( - 1)?$
19 description: Specification of a raw netlink protocol
21 required: [ name, doc, attribute-sets, operations ]
22 additionalProperties: False
25 description: Name of the netlink family.
30 description: Schema compatibility level.
31 enum: [ netlink-raw ] # Trim
34 description: Protocol number to use for netlink-raw
38 description: Path to the uAPI header, default is linux/${family-name}.h
42 description: Name of the define for the family name.
45 description: Name of the define for the version of the family.
48 description: Makes the number of attributes and commands be specified by a define, not an enum value.
51 # Start genetlink-legacy
54 Defines if the input policy in the kernel is global, per-operation, or split per operation type.
56 enum: [ split, per-op, global ]
57 # End genetlink-legacy
60 description: List of type and constant definitions (enums, flags, defines).
64 required: [ type, name ]
65 additionalProperties: False
70 description: For C-compatible languages, header which already defines this value.
73 enum: [ const, enum, flags, struct ] # Trim
78 description: For const - the value.
79 type: [ string, integer ]
82 description: For enum or flags the literal initializer for the first value.
83 type: [ string, integer ]
85 description: For enum or flags array of values.
92 additionalProperties: False
101 description: Render the max members for this enum.
105 description: Name for enum, if empty no name will be used.
106 type: [ string, "null" ]
108 description: For enum the prefix of the values, optional.
111 # Start genetlink-legacy
113 description: List of struct members. Only scalars and strings members allowed.
117 required: [ name, type ]
118 additionalProperties: False
123 description: The netlink attribute type
124 enum: [ u8, u16, u32, u64, s8, s16, s32, s64, string, binary ]
126 $ref: '#/$defs/len-or-define'
128 enum: [ little-endian, big-endian ]
130 description: Documentation for the struct member attribute.
133 description: Name of the enum type used for the attribute.
137 Treat the enum as flags. In most cases enum is either used as flags or as values.
138 Sometimes, however, both forms are necessary, in which case header contains the enum
139 form while specific attributes may request to convert the values into a bitfield.
141 display-hint: &display-hint
143 Optional format indicator that is intended only for choosing
144 the right formatting mechanism when displaying values of this
146 enum: [ hex, mac, fddi, ipv4, ipv6, uuid ]
147 # End genetlink-legacy
150 description: Definition of attribute spaces for this family.
153 description: Definition of a single attribute space.
155 required: [ name, attributes ]
156 additionalProperties: False
160 Name used when referring to this space in other definitions, not used outside of the spec.
164 Prefix for the C enum name of the attributes. Default family[name]-set[name]-a-
167 description: Name for the enum type of the attribute.
170 description: Documentation of the space.
174 Name of another space which this is a logical part of. Sub-spaces can be used to define
175 a limited group of attributes which are used in a nest.
179 description: The explicit name for constant holding the count of attributes (last attr + 1).
182 description: The explicit name for last member of attribute enum.
186 description: List of attributes in the space.
190 required: [ name, type ]
191 additionalProperties: False
196 description: The netlink attribute type
197 enum: [ unused, pad, flag, binary, u8, u16, u32, u64, s32, s64,
198 string, nest, array-nest, nest-type-value ]
200 description: Documentation of the attribute.
203 description: Value for the enum item representing this attribute in the uAPI.
206 description: Name of the value extracted from the type of a nest-type-value attribute.
211 enum: [ little-endian, big-endian ]
215 description: Name of the space (sub-space) used inside the attribute.
218 description: Name of the enum type used for the attribute.
222 Treat the enum as flags. In most cases enum is either used as flags or as values.
223 Sometimes, however, both forms are necessary, in which case header contains the enum
224 form while specific attributes may request to convert the values into a bitfield.
227 description: Kernel input validation.
229 additionalProperties: False
232 description: Name of the flags constant on which to base mask (unsigned scalar types only).
235 description: Min value for an integer attribute.
238 description: Min length for a binary attribute.
239 $ref: '#/$defs/len-or-define'
241 description: Max length for a string or a binary attribute.
242 $ref: '#/$defs/len-or-define'
244 display-hint: *display-hint
249 # Start genetlink-legacy
251 description: Name of the struct type used for the attribute.
253 # End genetlink-legacy
255 # Make sure name-prefix does not appear in subsets (subsets inherit naming)
259 required: [ subset-of ]
262 required: [ name-prefix ]
265 description: Operations supported by the protocol.
268 additionalProperties: False
272 The model of assigning values to the operations.
273 "unified" is the recommended model where all message types belong
275 "directional" has the messages sent to the kernel and from the kernel
276 enumerated separately.
277 enum: [ unified, directional ] # Trim
280 Prefix for the C enum name of the command. The name is formed by concatenating
281 the prefix with the upper case name of the command, with dashes replaced by underscores.
284 description: Name for the enum type with commands.
287 description: Same as name-prefix but used to render notifications and events to separate enum.
290 description: Name for the enum type with notifications/events.
292 # Start genetlink-legacy
293 fixed-header: &fixed-header
295 Name of the structure defining the optional fixed-length protocol
296 header. This header is placed in a message after the netlink and
297 genetlink headers and before any attributes.
299 # End genetlink-legacy
301 description: List of commands
305 additionalProperties: False
306 required: [ name, doc ]
309 description: Name of the operation, also defining its C enum value in uAPI.
312 description: Documentation for the command.
315 description: Value for the enum in the uAPI.
319 Attribute space from which attributes directly in the requests and replies
320 to this command are defined.
323 description: Command flags.
328 description: Kernel attribute validation flags.
331 enum: [ strict, dump ]
332 # Start genetlink-legacy
333 fixed-header: *fixed-header
334 # End genetlink-legacy
336 description: Main command handler.
338 additionalProperties: False
340 request: &subop-attr-list
341 description: Definition of the request message for a given command.
343 additionalProperties: False
347 Names of attributes from the attribute-set (not full attribute
348 definitions, just names).
352 # Start genetlink-legacy
355 ID of this message if value for request and response differ,
356 i.e. requests and responses have different message enums.
358 # End genetlink-legacy
359 reply: *subop-attr-list
361 description: Hook for a function to run before the main callback (pre_doit or start).
364 description: Hook for a function to run after the main callback (post_doit or done).
368 description: Name of the command sharing the reply type with this notification.
372 additionalProperties: False
375 description: Explicit list of the attributes for the notification.
380 description: Name of the multicast group generating given notification.
383 description: List of multicast groups.
386 additionalProperties: False
389 description: List of groups.
394 additionalProperties: False
398 The name for the group, used to form the define and the value of the define.
402 description: Override for the name of the define in C uAPI.
408 description: Value of the netlink multicast group in the uAPI.