1 # SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)
4 $id: http://kernel.org/schemas/netlink/genetlink-c.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: Schema compatibility level. Default is "genetlink".
31 enum: [ genetlink, genetlink-c ]
33 description: Path to the uAPI header, default is linux/${family-name}.h
37 description: Name of the define for the family name.
40 description: Name of the define for the version of the family.
43 description: Makes the number of attributes and commands be specified by a define, not an enum value.
48 description: List of type and constant definitions (enums, flags, defines).
52 required: [ type, name ]
53 additionalProperties: False
58 description: For C-compatible languages, header which already defines this value.
61 enum: [ const, enum, flags ]
66 description: For const - the value.
67 type: [ string, integer ]
70 description: For enum or flags the literal initializer for the first value.
71 type: [ string, integer ]
73 description: For enum or flags array of values.
80 additionalProperties: False
89 description: Render the max members for this enum.
93 description: Name for enum, if empty no name will be used.
94 type: [ string, "null" ]
96 description: For enum the prefix of the values, optional.
101 description: Definition of attribute spaces for this family.
104 description: Definition of a single attribute space.
106 required: [ name, attributes ]
107 additionalProperties: False
111 Name used when referring to this space in other definitions, not used outside of the spec.
115 Prefix for the C enum name of the attributes. Default family[name]-set[name]-a-
118 description: Name for the enum type of the attribute.
121 description: Documentation of the space.
125 Name of another space which this is a logical part of. Sub-spaces can be used to define
126 a limited group of attributes which are used in a nest.
130 description: The explicit name for constant holding the count of attributes (last attr + 1).
133 description: The explicit name for last member of attribute enum.
137 description: List of attributes in the space.
142 additionalProperties: False
147 enum: [ unused, pad, flag, binary, u8, u16, u32, u64, s32, s64,
148 string, nest, array-nest, nest-type-value ]
150 description: Documentation of the attribute.
153 description: Value for the enum item representing this attribute in the uAPI.
156 description: Name of the value extracted from the type of a nest-type-value attribute.
161 enum: [ little-endian, big-endian ]
165 description: Name of the space (sub-space) used inside the attribute.
168 description: Name of the enum type used for the attribute.
172 Treat the enum as flags. In most cases enum is either used as flags or as values.
173 Sometimes, however, both forms are necessary, in which case header contains the enum
174 form while specific attributes may request to convert the values into a bitfield.
177 description: Kernel input validation.
179 additionalProperties: False
182 description: Name of the flags constant on which to base mask (unsigned scalar types only).
185 description: Min value for an integer attribute.
188 description: Min length for a binary attribute.
189 $ref: '#/$defs/len-or-define'
191 description: Max length for a string or a binary attribute.
192 $ref: '#/$defs/len-or-define'
194 display-hint: &display-hint
196 Optional format indicator that is intended only for choosing
197 the right formatting mechanism when displaying values of this
199 enum: [ hex, mac, fddi, ipv4, ipv6, uuid ]
205 # Make sure name-prefix does not appear in subsets (subsets inherit naming)
209 required: [ subset-of ]
212 required: [ name-prefix ]
214 # type property is only required if not in subset definition
227 description: Operations supported by the protocol.
230 additionalProperties: False
234 The model of assigning values to the operations.
235 "unified" is the recommended model where all message types belong
237 "directional" has the messages sent to the kernel and from the kernel
238 enumerated separately.
242 Prefix for the C enum name of the command. The name is formed by concatenating
243 the prefix with the upper case name of the command, with dashes replaced by underscores.
246 description: Name for the enum type with commands.
249 description: Same as name-prefix but used to render notifications and events to separate enum.
252 description: Name for the enum type with notifications/events.
255 description: List of commands
259 additionalProperties: False
260 required: [ name, doc ]
263 description: Name of the operation, also defining its C enum value in uAPI.
266 description: Documentation for the command.
269 description: Value for the enum in the uAPI.
273 Attribute space from which attributes directly in the requests and replies
274 to this command are defined.
277 description: Command flags.
282 description: Kernel attribute validation flags.
285 enum: [ strict, dump, dump-strict ]
287 description: Main command handler.
289 additionalProperties: False
291 request: &subop-attr-list
292 description: Definition of the request message for a given command.
294 additionalProperties: False
298 Names of attributes from the attribute-set (not full attribute
299 definitions, just names).
303 reply: *subop-attr-list
305 description: Hook for a function to run before the main callback (pre_doit or start).
308 description: Hook for a function to run after the main callback (post_doit or done).
312 description: Name of the command sharing the reply type with this notification.
316 additionalProperties: False
319 description: Explicit list of the attributes for the notification.
324 description: Name of the multicast group generating given notification.
327 description: List of multicast groups.
330 additionalProperties: False
333 description: List of groups.
338 additionalProperties: False
342 The name for the group, used to form the define and the value of the define.
346 description: Override for the name of the define in C uAPI.