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 ]
163 # End genetlink-legacy
166 description: Definition of attribute spaces for this family.
169 description: Definition of a single attribute space.
171 required: [ name, attributes ]
172 additionalProperties: False
176 Name used when referring to this space in other definitions, not used outside of the spec.
180 Prefix for the C enum name of the attributes. Default family[name]-set[name]-a-
183 description: Name for the enum type of the attribute.
186 description: Documentation of the space.
190 Name of another space which this is a logical part of. Sub-spaces can be used to define
191 a limited group of attributes which are used in a nest.
195 description: The explicit name for constant holding the count of attributes (last attr + 1).
198 description: The explicit name for last member of attribute enum.
202 description: List of attributes in the space.
207 additionalProperties: False
212 description: The netlink attribute type
213 enum: [ unused, pad, flag, binary, bitfield32,
214 u8, u16, u32, u64, s8, s16, s32, s64,
215 string, nest, array-nest, nest-type-value,
218 description: Documentation of the attribute.
221 description: Value for the enum item representing this attribute in the uAPI.
224 description: Name of the value extracted from the type of a nest-type-value attribute.
229 enum: [ little-endian, big-endian ]
233 description: Name of the space (sub-space) used inside the attribute.
236 description: Name of the enum type used for the attribute.
240 Treat the enum as flags. In most cases enum is either used as flags or as values.
241 Sometimes, however, both forms are necessary, in which case header contains the enum
242 form while specific attributes may request to convert the values into a bitfield.
245 description: Kernel input validation.
247 additionalProperties: False
250 description: Name of the flags constant on which to base mask (unsigned scalar types only).
253 description: Min value for an integer attribute.
256 description: Min length for a binary attribute.
257 $ref: '#/$defs/len-or-define'
259 description: Max length for a string or a binary attribute.
260 $ref: '#/$defs/len-or-define'
262 description: Exact length for a string or a binary attribute.
263 $ref: '#/$defs/len-or-define'
265 display-hint: *display-hint
270 # Start genetlink-legacy
272 description: Name of the struct type used for the attribute.
274 # End genetlink-legacy
278 Name of the sub-message definition to use for the attribute.
282 Name of the attribute to use for dynamic selection of sub-message
287 # Make sure name-prefix does not appear in subsets (subsets inherit naming)
291 required: [ subset-of ]
294 required: [ name-prefix ]
296 # type property is only required if not in subset definition
310 description: Definition of sub message attributes
314 additionalProperties: False
315 required: [ name, formats ]
318 description: Name of the sub-message definition
321 description: Dynamically selected format specifiers
325 additionalProperties: False
330 Value to match for dynamic selection of sub-message format
335 Name of the struct definition to use as the fixed header
340 Name of the attribute space from which to resolve attributes
346 description: Operations supported by the protocol.
349 additionalProperties: False
353 The model of assigning values to the operations.
354 "unified" is the recommended model where all message types belong
356 "directional" has the messages sent to the kernel and from the kernel
357 enumerated separately.
358 enum: [ unified, directional ] # Trim
361 Prefix for the C enum name of the command. The name is formed by concatenating
362 the prefix with the upper case name of the command, with dashes replaced by underscores.
365 description: Name for the enum type with commands.
368 description: Same as name-prefix but used to render notifications and events to separate enum.
371 description: Name for the enum type with notifications/events.
373 # Start genetlink-legacy
374 fixed-header: &fixed-header
376 Name of the structure defining the optional fixed-length protocol
377 header. This header is placed in a message after the netlink and
378 genetlink headers and before any attributes.
380 # End genetlink-legacy
382 description: List of commands
386 additionalProperties: False
387 required: [ name, doc ]
390 description: Name of the operation, also defining its C enum value in uAPI.
393 description: Documentation for the command.
396 description: Value for the enum in the uAPI.
400 Attribute space from which attributes directly in the requests and replies
401 to this command are defined.
404 description: Command flags.
409 description: Kernel attribute validation flags.
412 enum: [ strict, dump ]
413 # Start genetlink-legacy
414 fixed-header: *fixed-header
415 # End genetlink-legacy
417 description: Main command handler.
419 additionalProperties: False
421 request: &subop-attr-list
422 description: Definition of the request message for a given command.
424 additionalProperties: False
428 Names of attributes from the attribute-set (not full attribute
429 definitions, just names).
433 # Start genetlink-legacy
436 ID of this message if value for request and response differ,
437 i.e. requests and responses have different message enums.
439 # End genetlink-legacy
440 reply: *subop-attr-list
442 description: Hook for a function to run before the main callback (pre_doit or start).
445 description: Hook for a function to run after the main callback (post_doit or done).
449 description: Name of the command sharing the reply type with this notification.
453 additionalProperties: False
456 description: Explicit list of the attributes for the notification.
461 description: Name of the multicast group generating given notification.
464 description: List of multicast groups.
467 additionalProperties: False
470 description: List of groups.
475 additionalProperties: False
479 The name for the group, used to form the define and the value of the define.
483 description: Override for the name of the define in C uAPI.
489 description: Value of the netlink multicast group in the uAPI.