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
129 description: The netlink attribute type
130 enum: [ u8, u16, u32, u64, s8, s16, s32, s64, string, binary ]
132 $ref: '#/$defs/len-or-define'
134 enum: [ little-endian, big-endian ]
136 description: Documentation for the struct member attribute.
139 description: Name of the enum type used for the attribute.
143 Treat the enum as flags. In most cases enum is either used as flags or as values.
144 Sometimes, however, both forms are necessary, in which case header contains the enum
145 form while specific attributes may request to convert the values into a bitfield.
147 display-hint: &display-hint
149 Optional format indicator that is intended only for choosing
150 the right formatting mechanism when displaying values of this
152 enum: [ hex, mac, fddi, ipv4, ipv6, uuid ]
153 # End genetlink-legacy
156 description: Definition of attribute spaces for this family.
159 description: Definition of a single attribute space.
161 required: [ name, attributes ]
162 additionalProperties: False
166 Name used when referring to this space in other definitions, not used outside of the spec.
170 Prefix for the C enum name of the attributes. Default family[name]-set[name]-a-
173 description: Name for the enum type of the attribute.
176 description: Documentation of the space.
180 Name of another space which this is a logical part of. Sub-spaces can be used to define
181 a limited group of attributes which are used in a nest.
185 description: The explicit name for constant holding the count of attributes (last attr + 1).
188 description: The explicit name for last member of attribute enum.
192 description: List of attributes in the space.
197 additionalProperties: False
202 description: The netlink attribute type
203 enum: [ unused, pad, flag, binary, u8, u16, u32, u64, s32, s64,
204 string, nest, array-nest, nest-type-value ]
206 description: Documentation of the attribute.
209 description: Value for the enum item representing this attribute in the uAPI.
212 description: Name of the value extracted from the type of a nest-type-value attribute.
217 enum: [ little-endian, big-endian ]
221 description: Name of the space (sub-space) used inside the attribute.
224 description: Name of the enum type used for the attribute.
228 Treat the enum as flags. In most cases enum is either used as flags or as values.
229 Sometimes, however, both forms are necessary, in which case header contains the enum
230 form while specific attributes may request to convert the values into a bitfield.
233 description: Kernel input validation.
235 additionalProperties: False
238 description: Name of the flags constant on which to base mask (unsigned scalar types only).
241 description: Min value for an integer attribute.
244 description: Min length for a binary attribute.
245 $ref: '#/$defs/len-or-define'
247 description: Max length for a string or a binary attribute.
248 $ref: '#/$defs/len-or-define'
250 description: Exact length for a string or a binary attribute.
251 $ref: '#/$defs/len-or-define'
253 display-hint: *display-hint
258 # Start genetlink-legacy
260 description: Name of the struct type used for the attribute.
262 # End genetlink-legacy
264 # Make sure name-prefix does not appear in subsets (subsets inherit naming)
268 required: [ subset-of ]
271 required: [ name-prefix ]
273 # type property is only required if not in subset definition
286 description: Operations supported by the protocol.
289 additionalProperties: False
293 The model of assigning values to the operations.
294 "unified" is the recommended model where all message types belong
296 "directional" has the messages sent to the kernel and from the kernel
297 enumerated separately.
298 enum: [ unified, directional ] # Trim
301 Prefix for the C enum name of the command. The name is formed by concatenating
302 the prefix with the upper case name of the command, with dashes replaced by underscores.
305 description: Name for the enum type with commands.
308 description: Same as name-prefix but used to render notifications and events to separate enum.
311 description: Name for the enum type with notifications/events.
313 # Start genetlink-legacy
314 fixed-header: &fixed-header
316 Name of the structure defining the optional fixed-length protocol
317 header. This header is placed in a message after the netlink and
318 genetlink headers and before any attributes.
320 # End genetlink-legacy
322 description: List of commands
326 additionalProperties: False
327 required: [ name, doc ]
330 description: Name of the operation, also defining its C enum value in uAPI.
333 description: Documentation for the command.
336 description: Value for the enum in the uAPI.
340 Attribute space from which attributes directly in the requests and replies
341 to this command are defined.
344 description: Command flags.
349 description: Kernel attribute validation flags.
352 enum: [ strict, dump ]
353 # Start genetlink-legacy
354 fixed-header: *fixed-header
355 # End genetlink-legacy
357 description: Main command handler.
359 additionalProperties: False
361 request: &subop-attr-list
362 description: Definition of the request message for a given command.
364 additionalProperties: False
368 Names of attributes from the attribute-set (not full attribute
369 definitions, just names).
373 # Start genetlink-legacy
376 ID of this message if value for request and response differ,
377 i.e. requests and responses have different message enums.
379 # End genetlink-legacy
380 reply: *subop-attr-list
382 description: Hook for a function to run before the main callback (pre_doit or start).
385 description: Hook for a function to run after the main callback (post_doit or done).
389 description: Name of the command sharing the reply type with this notification.
393 additionalProperties: False
396 description: Explicit list of the attributes for the notification.
401 description: Name of the multicast group generating given notification.
404 description: List of multicast groups.
407 additionalProperties: False
410 description: List of groups.
415 additionalProperties: False
419 The name for the group, used to form the define and the value of the define.
423 description: Override for the name of the define in C uAPI.
429 description: Value of the netlink multicast group in the uAPI.