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 description: Name of the define for the last operation in the list.
54 description: The explicit name for constant holding the count of operations (last operation + 1).
57 # Start genetlink-legacy
60 Defines if the input policy in the kernel is global, per-operation, or split per operation type.
62 enum: [ split, per-op, global ]
63 # End genetlink-legacy
66 description: List of type and constant definitions (enums, flags, defines).
70 required: [ type, name ]
71 additionalProperties: False
76 description: For C-compatible languages, header which already defines this value.
79 enum: [ const, enum, flags, struct ] # Trim
84 description: For const - the value.
85 type: [ string, integer ]
88 description: For enum or flags the literal initializer for the first value.
89 type: [ string, integer ]
91 description: For enum or flags array of values.
98 additionalProperties: False
107 description: Render the max members for this enum.
111 description: Name for enum, if empty no name will be used.
112 type: [ string, "null" ]
114 description: For enum the prefix of the values, optional.
117 # Start genetlink-legacy
119 description: List of struct members. Only scalars and strings members allowed.
123 required: [ name, type ]
124 additionalProperties: False
130 The netlink attribute type. Members of type 'binary' or 'pad'
131 must also have the 'len' property set.
132 enum: [ u8, u16, u32, u64, s8, s16, s32, s64, string, binary, pad ]
134 $ref: '#/$defs/len-or-define'
136 enum: [ little-endian, big-endian ]
138 description: Documentation for the struct member attribute.
141 description: Name of the enum type used for the attribute.
145 Treat the enum as flags. In most cases enum is either used as flags or as values.
146 Sometimes, however, both forms are necessary, in which case header contains the enum
147 form while specific attributes may request to convert the values into a bitfield.
149 display-hint: &display-hint
151 Optional format indicator that is intended only for choosing
152 the right formatting mechanism when displaying values of this
154 enum: [ hex, mac, fddi, ipv4, ipv6, uuid ]
156 description: Name of the nested struct type.
171 - required: [ struct ]
172 # End genetlink-legacy
175 description: Definition of attribute spaces for this family.
178 description: Definition of a single attribute space.
180 required: [ name, attributes ]
181 additionalProperties: False
185 Name used when referring to this space in other definitions, not used outside of the spec.
189 Prefix for the C enum name of the attributes. Default family[name]-set[name]-a-
193 Name for the enum type of the attribute, if empty no name will be used.
194 type: [ string, "null" ]
196 description: Documentation of the space.
200 Name of another space which this is a logical part of. Sub-spaces can be used to define
201 a limited group of attributes which are used in a nest.
205 description: The explicit name for constant holding the count of attributes (last attr + 1).
208 description: The explicit name for last member of attribute enum.
212 description: List of attributes in the space.
217 additionalProperties: False
222 description: The netlink attribute type
223 enum: [ unused, pad, flag, binary, bitfield32,
224 u8, u16, u32, u64, s8, s16, s32, s64,
225 string, nest, indexed-array, nest-type-value,
228 description: Documentation of the attribute.
231 description: Value for the enum item representing this attribute in the uAPI.
234 description: Name of the value extracted from the type of a nest-type-value attribute.
239 enum: [ little-endian, big-endian ]
243 description: Name of the space (sub-space) used inside the attribute.
246 description: Name of the enum type used for the attribute.
250 Treat the enum as flags. In most cases enum is either used as flags or as values.
251 Sometimes, however, both forms are necessary, in which case header contains the enum
252 form while specific attributes may request to convert the values into a bitfield.
255 description: Kernel input validation.
257 additionalProperties: False
260 description: Name of the flags constant on which to base mask (unsigned scalar types only).
263 description: Min value for an integer attribute.
266 description: Min length for a binary attribute.
267 $ref: '#/$defs/len-or-define'
269 description: Max length for a string or a binary attribute.
270 $ref: '#/$defs/len-or-define'
272 description: Exact length for a string or a binary attribute.
273 $ref: '#/$defs/len-or-define'
276 For string attributes, do not check whether attribute
277 contains the terminating null character.
280 display-hint: *display-hint
285 # Start genetlink-legacy
287 description: Name of the struct type used for the attribute.
289 # End genetlink-legacy
293 Name of the sub-message definition to use for the attribute.
297 Name of the attribute to use for dynamic selection of sub-message
302 # Make sure name-prefix does not appear in subsets (subsets inherit naming)
306 required: [ subset-of ]
309 required: [ name-prefix ]
311 # type property is only required if not in subset definition
325 description: Definition of sub message attributes
329 additionalProperties: False
330 required: [ name, formats ]
333 description: Name of the sub-message definition
336 description: Dynamically selected format specifiers
340 additionalProperties: False
345 Value to match for dynamic selection of sub-message format
350 Name of the struct definition to use as the fixed header
355 Name of the attribute space from which to resolve attributes
361 description: Operations supported by the protocol.
364 additionalProperties: False
368 The model of assigning values to the operations.
369 "unified" is the recommended model where all message types belong
371 "directional" has the messages sent to the kernel and from the kernel
372 enumerated separately.
373 enum: [ unified, directional ] # Trim
376 Prefix for the C enum name of the command. The name is formed by concatenating
377 the prefix with the upper case name of the command, with dashes replaced by underscores.
381 Name for the enum type with commands, if empty no name will be used.
382 type: [ string, "null" ]
384 description: Same as name-prefix but used to render notifications and events to separate enum.
388 Name for the enum type with commands, if empty no name will be used.
389 type: [ string, "null" ]
390 # Start genetlink-legacy
391 fixed-header: &fixed-header
393 Name of the structure defining the optional fixed-length protocol
394 header. This header is placed in a message after the netlink and
395 genetlink headers and before any attributes.
397 # End genetlink-legacy
399 description: List of commands
403 additionalProperties: False
404 required: [ name, doc ]
407 description: Name of the operation, also defining its C enum value in uAPI.
410 description: Documentation for the command.
413 description: Value for the enum in the uAPI.
417 Attribute space from which attributes directly in the requests and replies
418 to this command are defined.
421 description: Command flags.
426 description: Kernel attribute validation flags.
429 enum: [ strict, dump ]
430 # Start genetlink-legacy
431 fixed-header: *fixed-header
432 # End genetlink-legacy
434 description: Main command handler.
436 additionalProperties: False
438 request: &subop-attr-list
439 description: Definition of the request message for a given command.
441 additionalProperties: False
445 Names of attributes from the attribute-set (not full attribute
446 definitions, just names).
450 # Start genetlink-legacy
453 ID of this message if value for request and response differ,
454 i.e. requests and responses have different message enums.
456 # End genetlink-legacy
457 reply: *subop-attr-list
459 description: Hook for a function to run before the main callback (pre_doit or start).
462 description: Hook for a function to run after the main callback (post_doit or done).
466 description: Name of the command sharing the reply type with this notification.
470 additionalProperties: False
473 description: Explicit list of the attributes for the notification.
478 description: Name of the multicast group generating given notification.
481 description: List of multicast groups.
484 additionalProperties: False
487 description: List of groups.
492 additionalProperties: False
496 The name for the group, used to form the define and the value of the define.
500 description: Override for the name of the define in C uAPI.
506 description: Value of the netlink multicast group in the uAPI.