1 # SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)
4 $id: http://kernel.org/schemas/netlink/genetlink-legacy.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 genetlink protocol
21 required: [ name, doc, attribute-sets, operations ]
22 additionalProperties: False
25 description: Name of the genetlink family.
30 description: Generic Netlink family version. Default is 1.
34 description: Schema compatibility level. Default is "genetlink".
37 description: Path to the uAPI header, default is linux/${family-name}.h
41 description: List of type and constant definitions (enums, flags, defines).
45 required: [ type, name ]
46 additionalProperties: False
51 description: For C-compatible languages, header which already defines this value.
54 enum: [ const, enum, flags ]
59 description: For const - the value.
60 type: [ string, integer ]
63 description: For enum or flags the literal initializer for the first value.
64 type: [ string, integer ]
66 description: For enum or flags array of values.
73 additionalProperties: False
82 description: Render the max members for this enum.
86 description: Definition of attribute spaces for this family.
89 description: Definition of a single attribute space.
91 required: [ name, attributes ]
92 additionalProperties: False
96 Name used when referring to this space in other definitions, not used outside of the spec.
100 Prefix for the C enum name of the attributes. Default family[name]-set[name]-a-
103 description: Name for the enum type of the attribute.
106 description: Documentation of the space.
110 Name of another space which this is a logical part of. Sub-spaces can be used to define
111 a limited group of attributes which are used in a nest.
114 description: List of attributes in the space.
118 required: [ name, type ]
119 additionalProperties: False
124 enum: [ unused, pad, flag, binary, u8, u16, u32, u64, s32, s64,
125 string, nest, array-nest, nest-type-value ]
127 description: Documentation of the attribute.
130 description: Value for the enum item representing this attribute in the uAPI.
133 description: Name of the value extracted from the type of a nest-type-value attribute.
138 enum: [ little-endian, big-endian ]
142 description: Name of the space (sub-space) used inside the attribute.
145 description: Name of the enum type used for the attribute.
149 Treat the enum as flags. In most cases enum is either used as flags or as values.
150 Sometimes, however, both forms are necessary, in which case header contains the enum
151 form while specific attributes may request to convert the values into a bitfield.
154 description: Kernel input validation.
156 additionalProperties: False
159 description: Name of the flags constant on which to base mask (unsigned scalar types only).
162 description: Min value for an integer attribute.
165 description: Min length for a binary attribute.
166 $ref: '#/$defs/len-or-define'
168 description: Max length for a string or a binary attribute.
169 $ref: '#/$defs/len-or-define'
172 # Make sure name-prefix does not appear in subsets (subsets inherit naming)
176 required: [ subset-of ]
179 required: [ name-prefix ]
182 description: Operations supported by the protocol.
185 additionalProperties: False
189 The model of assigning values to the operations.
190 "unified" is the recommended model where all message types belong
192 "directional" has the messages sent to the kernel and from the kernel
193 enumerated separately.
197 Prefix for the C enum name of the command. The name is formed by concatenating
198 the prefix with the upper case name of the command, with dashes replaced by underscores.
201 description: Name for the enum type with commands.
204 description: Same as name-prefix but used to render notifications and events to separate enum.
207 description: Name for the enum type with notifications/events.
210 description: List of commands
214 additionalProperties: False
215 required: [ name, doc ]
218 description: Name of the operation, also defining its C enum value in uAPI.
221 description: Documentation for the command.
224 description: Value for the enum in the uAPI.
228 Attribute space from which attributes directly in the requests and replies
229 to this command are defined.
232 description: Command flags.
237 description: Kernel attribute validation flags.
240 enum: [ strict, dump ]
242 description: Main command handler.
244 additionalProperties: False
246 request: &subop-attr-list
247 description: Definition of the request message for a given command.
249 additionalProperties: False
253 Names of attributes from the attribute-set (not full attribute
254 definitions, just names).
258 reply: *subop-attr-list
260 description: Hook for a function to run before the main callback (pre_doit or start).
263 description: Hook for a function to run after the main callback (post_doit or done).
267 description: Name of the command sharing the reply type with this notification.
271 additionalProperties: False
274 description: Explicit list of the attributes for the notification.
279 description: Name of the multicast group generating given notification.
282 description: List of multicast groups.
285 additionalProperties: False
288 description: List of groups.
293 additionalProperties: False
297 The name for the group, used to form the define and the value of the define.