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.
53 description: List of type and constant definitions (enums, flags, defines).
57 required: [ type, name ]
58 additionalProperties: False
63 description: For C-compatible languages, header which already defines this value.
66 enum: [ const, enum, flags ]
71 description: For const - the value.
72 type: [ string, integer ]
75 description: For enum or flags the literal initializer for the first value.
76 type: [ string, integer ]
78 description: For enum or flags array of values.
85 additionalProperties: False
94 description: Render the max members for this enum.
98 description: Name for enum, if empty no name will be used.
99 type: [ string, "null" ]
101 description: For enum the prefix of the values, optional.
106 description: Definition of attribute spaces for this family.
109 description: Definition of a single attribute space.
111 required: [ name, attributes ]
112 additionalProperties: False
116 Name used when referring to this space in other definitions, not used outside of the spec.
120 Prefix for the C enum name of the attributes. Default family[name]-set[name]-a-
123 description: Name for the enum type of the attribute.
126 description: Documentation of the space.
130 Name of another space which this is a logical part of. Sub-spaces can be used to define
131 a limited group of attributes which are used in a nest.
135 description: The explicit name for constant holding the count of attributes (last attr + 1).
138 description: The explicit name for last member of attribute enum.
142 description: List of attributes in the space.
147 additionalProperties: False
152 enum: [ unused, pad, flag, binary,
153 uint, sint, u8, u16, u32, u64, s32, s64,
154 string, nest, array-nest, nest-type-value ]
156 description: Documentation of the attribute.
159 description: Value for the enum item representing this attribute in the uAPI.
162 description: Name of the value extracted from the type of a nest-type-value attribute.
167 enum: [ little-endian, big-endian ]
171 description: Name of the space (sub-space) used inside the attribute.
174 description: Name of the enum type used for the attribute.
178 Treat the enum as flags. In most cases enum is either used as flags or as values.
179 Sometimes, however, both forms are necessary, in which case header contains the enum
180 form while specific attributes may request to convert the values into a bitfield.
183 description: Kernel input validation.
185 additionalProperties: False
188 description: Name of the flags constant on which to base mask (unsigned scalar types only).
191 description: Min value for an integer attribute.
192 $ref: '#/$defs/len-or-limit'
194 description: Max value for an integer attribute.
195 $ref: '#/$defs/len-or-limit'
197 description: Min length for a binary attribute.
198 $ref: '#/$defs/len-or-define'
200 description: Max length for a string or a binary attribute.
201 $ref: '#/$defs/len-or-define'
203 description: Exact length for a string or a binary attribute.
204 $ref: '#/$defs/len-or-define'
206 display-hint: &display-hint
208 Optional format indicator that is intended only for choosing
209 the right formatting mechanism when displaying values of this
211 enum: [ hex, mac, fddi, ipv4, ipv6, uuid ]
217 # Make sure name-prefix does not appear in subsets (subsets inherit naming)
221 required: [ subset-of ]
224 required: [ name-prefix ]
226 # type property is only required if not in subset definition
239 description: Operations supported by the protocol.
242 additionalProperties: False
246 The model of assigning values to the operations.
247 "unified" is the recommended model where all message types belong
249 "directional" has the messages sent to the kernel and from the kernel
250 enumerated separately.
254 Prefix for the C enum name of the command. The name is formed by concatenating
255 the prefix with the upper case name of the command, with dashes replaced by underscores.
258 description: Name for the enum type with commands.
261 description: Same as name-prefix but used to render notifications and events to separate enum.
264 description: Name for the enum type with notifications/events.
267 description: List of commands
271 additionalProperties: False
272 required: [ name, doc ]
275 description: Name of the operation, also defining its C enum value in uAPI.
278 description: Documentation for the command.
281 description: Value for the enum in the uAPI.
285 Attribute space from which attributes directly in the requests and replies
286 to this command are defined.
289 description: Command flags.
294 description: Kernel attribute validation flags.
297 enum: [ strict, dump, dump-strict ]
300 Name of the kernel config option gating the presence of
301 the operation, without the 'CONFIG_' prefix.
304 description: Main command handler.
306 additionalProperties: False
308 request: &subop-attr-list
309 description: Definition of the request message for a given command.
311 additionalProperties: False
315 Names of attributes from the attribute-set (not full attribute
316 definitions, just names).
320 reply: *subop-attr-list
322 description: Hook for a function to run before the main callback (pre_doit or start).
325 description: Hook for a function to run after the main callback (post_doit or done).
329 description: Name of the command sharing the reply type with this notification.
333 additionalProperties: False
336 description: Explicit list of the attributes for the notification.
341 description: Name of the multicast group generating given notification.
344 description: List of multicast groups.
347 additionalProperties: False
350 description: List of groups.
355 additionalProperties: False
359 The name for the group, used to form the define and the value of the define.
363 description: Override for the name of the define in C uAPI.