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'
171 display-hint: &display-hint
173 Optional format indicator that is intended only for choosing
174 the right formatting mechanism when displaying values of this
176 enum: [ hex, mac, fddi, ipv4, ipv6, uuid ]
178 # Make sure name-prefix does not appear in subsets (subsets inherit naming)
182 required: [ subset-of ]
185 required: [ name-prefix ]
188 description: Operations supported by the protocol.
191 additionalProperties: False
195 The model of assigning values to the operations.
196 "unified" is the recommended model where all message types belong
198 "directional" has the messages sent to the kernel and from the kernel
199 enumerated separately.
203 Prefix for the C enum name of the command. The name is formed by concatenating
204 the prefix with the upper case name of the command, with dashes replaced by underscores.
207 description: Name for the enum type with commands.
210 description: Same as name-prefix but used to render notifications and events to separate enum.
213 description: Name for the enum type with notifications/events.
216 description: List of commands
220 additionalProperties: False
221 required: [ name, doc ]
224 description: Name of the operation, also defining its C enum value in uAPI.
227 description: Documentation for the command.
230 description: Value for the enum in the uAPI.
234 Attribute space from which attributes directly in the requests and replies
235 to this command are defined.
238 description: Command flags.
243 description: Kernel attribute validation flags.
246 enum: [ strict, dump ]
248 description: Main command handler.
250 additionalProperties: False
252 request: &subop-attr-list
253 description: Definition of the request message for a given command.
255 additionalProperties: False
259 Names of attributes from the attribute-set (not full attribute
260 definitions, just names).
264 reply: *subop-attr-list
266 description: Hook for a function to run before the main callback (pre_doit or start).
269 description: Hook for a function to run after the main callback (post_doit or done).
273 description: Name of the command sharing the reply type with this notification.
277 additionalProperties: False
280 description: Explicit list of the attributes for the notification.
285 description: Name of the multicast group generating given notification.
288 description: List of multicast groups.
291 additionalProperties: False
294 description: List of groups.
299 additionalProperties: False
303 The name for the group, used to form the define and the value of the define.