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)?$
17 # literal int or limit based on fixed-width type e.g. u8-min, u16-max, etc.
18 type: [ string, integer ]
19 pattern: ^[su](8|16|32|64)-(min|max)$
24 description: Specification of a genetlink protocol
26 required: [ name, doc, attribute-sets, operations ]
27 additionalProperties: False
30 description: Name of the genetlink family.
35 description: Schema compatibility level. Default is "genetlink".
36 enum: [ genetlink, genetlink-c ]
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).
59 description: List of type and constant definitions (enums, flags, defines).
63 required: [ type, name ]
64 additionalProperties: False
69 description: For C-compatible languages, header which already defines this value.
72 enum: [ const, enum, flags ]
77 description: For const - the value.
78 type: [ string, integer ]
81 description: For enum or flags the literal initializer for the first value.
82 type: [ string, integer ]
84 description: For enum or flags array of values.
91 additionalProperties: False
100 description: Render the max members for this enum.
104 description: Name for enum, if empty no name will be used.
105 type: [ string, "null" ]
107 description: For enum the prefix of the values, optional.
112 description: Definition of attribute spaces for this family.
115 description: Definition of a single attribute space.
117 required: [ name, attributes ]
118 additionalProperties: False
122 Name used when referring to this space in other definitions, not used outside of the spec.
126 Prefix for the C enum name of the attributes. Default family[name]-set[name]-a-
129 description: Name for the enum type of the attribute.
132 description: Documentation of the space.
136 Name of another space which this is a logical part of. Sub-spaces can be used to define
137 a limited group of attributes which are used in a nest.
141 description: The explicit name for constant holding the count of attributes (last attr + 1).
144 description: The explicit name for last member of attribute enum.
148 description: List of attributes in the space.
153 additionalProperties: False
158 enum: [ unused, pad, flag, binary,
159 uint, sint, u8, u16, u32, u64, s32, s64,
160 string, nest, array-nest, nest-type-value ]
162 description: Documentation of the attribute.
165 description: Value for the enum item representing this attribute in the uAPI.
168 description: Name of the value extracted from the type of a nest-type-value attribute.
173 enum: [ little-endian, big-endian ]
177 description: Name of the space (sub-space) used inside the attribute.
180 description: Name of the enum type used for the attribute.
184 Treat the enum as flags. In most cases enum is either used as flags or as values.
185 Sometimes, however, both forms are necessary, in which case header contains the enum
186 form while specific attributes may request to convert the values into a bitfield.
189 description: Kernel input validation.
191 additionalProperties: False
194 description: Name of the flags constant on which to base mask (unsigned scalar types only).
197 description: Min value for an integer attribute.
198 $ref: '#/$defs/len-or-limit'
200 description: Max value for an integer attribute.
201 $ref: '#/$defs/len-or-limit'
203 description: Min length for a binary attribute.
204 $ref: '#/$defs/len-or-define'
206 description: Max length for a string or a binary attribute.
207 $ref: '#/$defs/len-or-define'
209 description: Exact length for a string or a binary attribute.
210 $ref: '#/$defs/len-or-define'
212 display-hint: &display-hint
214 Optional format indicator that is intended only for choosing
215 the right formatting mechanism when displaying values of this
217 enum: [ hex, mac, fddi, ipv4, ipv6, uuid ]
223 # Make sure name-prefix does not appear in subsets (subsets inherit naming)
227 required: [ subset-of ]
230 required: [ name-prefix ]
232 # type property is only required if not in subset definition
245 description: Operations supported by the protocol.
248 additionalProperties: False
252 The model of assigning values to the operations.
253 "unified" is the recommended model where all message types belong
255 "directional" has the messages sent to the kernel and from the kernel
256 enumerated separately.
260 Prefix for the C enum name of the command. The name is formed by concatenating
261 the prefix with the upper case name of the command, with dashes replaced by underscores.
264 description: Name for the enum type with commands.
267 description: Same as name-prefix but used to render notifications and events to separate enum.
270 description: Name for the enum type with notifications/events.
273 description: List of commands
277 additionalProperties: False
278 required: [ name, doc ]
281 description: Name of the operation, also defining its C enum value in uAPI.
284 description: Documentation for the command.
287 description: Value for the enum in the uAPI.
291 Attribute space from which attributes directly in the requests and replies
292 to this command are defined.
295 description: Command flags.
300 description: Kernel attribute validation flags.
303 enum: [ strict, dump, dump-strict ]
306 Name of the kernel config option gating the presence of
307 the operation, without the 'CONFIG_' prefix.
310 description: Main command handler.
312 additionalProperties: False
314 request: &subop-attr-list
315 description: Definition of the request message for a given command.
317 additionalProperties: False
321 Names of attributes from the attribute-set (not full attribute
322 definitions, just names).
326 reply: *subop-attr-list
328 description: Hook for a function to run before the main callback (pre_doit or start).
331 description: Hook for a function to run after the main callback (post_doit or done).
335 description: Name of the command sharing the reply type with this notification.
339 additionalProperties: False
342 description: Explicit list of the attributes for the notification.
347 description: Name of the multicast group generating given notification.
350 description: List of multicast groups.
353 additionalProperties: False
356 description: List of groups.
361 additionalProperties: False
365 The name for the group, used to form the define and the value of the define.
369 description: Override for the name of the define in C uAPI.