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: Generic Netlink family version. Default is 1.
34 description: Schema compatibility level. Default is "genetlink".
35 enum: [ genetlink, genetlink-c ]
37 description: Path to the uAPI header, default is linux/${family-name}.h
41 description: Name of the define for the family name.
44 description: Name of the define for the verion of the family.
47 description: Makes the number of attributes and commands be specified by a define, not an enum value.
52 description: List of type and constant definitions (enums, flags, defines).
56 required: [ type, name ]
57 additionalProperties: False
62 description: For C-compatible languages, header which already defines this value.
65 enum: [ const, enum, flags ]
70 description: For const - the value.
71 type: [ string, integer ]
74 description: For enum or flags the literal initializer for the first value.
75 type: [ string, integer ]
77 description: For enum or flags array of values.
84 additionalProperties: False
93 description: Render the max members for this enum.
97 description: Name for enum, if empty no name will be used.
98 type: [ string, "null" ]
100 description: For enum the prefix of the values, optional.
105 description: Definition of attribute spaces for this family.
108 description: Definition of a single attribute space.
110 required: [ name, attributes ]
111 additionalProperties: False
115 Name used when referring to this space in other definitions, not used outside of the spec.
119 Prefix for the C enum name of the attributes. Default family[name]-set[name]-a-
122 description: Name for the enum type of the attribute.
125 description: Documentation of the space.
129 Name of another space which this is a logical part of. Sub-spaces can be used to define
130 a limited group of attributes which are used in a nest.
134 description: The explicit name for constant holding the count of attributes (last attr + 1).
137 description: The explicit name for last member of attribute enum.
141 description: List of attributes in the space.
145 required: [ name, type ]
146 additionalProperties: False
151 enum: [ unused, pad, flag, binary, u8, u16, u32, u64, s32, s64,
152 string, nest, array-nest, nest-type-value ]
154 description: Documentation of the attribute.
157 description: Value for the enum item representing this attribute in the uAPI.
160 description: Name of the value extracted from the type of a nest-type-value attribute.
165 enum: [ little-endian, big-endian ]
169 description: Name of the space (sub-space) used inside the attribute.
172 description: Name of the enum type used for the attribute.
176 Treat the enum as flags. In most cases enum is either used as flags or as values.
177 Sometimes, however, both forms are necessary, in which case header contains the enum
178 form while specific attributes may request to convert the values into a bitfield.
181 description: Kernel input validation.
183 additionalProperties: False
186 description: Name of the flags constant on which to base mask (unsigned scalar types only).
189 description: Min value for an integer attribute.
192 description: Min length for a binary attribute.
193 $ref: '#/$defs/len-or-define'
195 description: Max length for a string or a binary attribute.
196 $ref: '#/$defs/len-or-define'
199 # Make sure name-prefix does not appear in subsets (subsets inherit naming)
203 required: [ subset-of ]
206 required: [ name-prefix ]
209 description: Operations supported by the protocol.
212 additionalProperties: False
216 The model of assigning values to the operations.
217 "unified" is the recommended model where all message types belong
219 "directional" has the messages sent to the kernel and from the kernel
220 enumerated separately.
224 Prefix for the C enum name of the command. The name is formed by concatenating
225 the prefix with the upper case name of the command, with dashes replaced by underscores.
228 description: Name for the enum type with commands.
231 description: Same as name-prefix but used to render notifications and events to separate enum.
234 description: Name for the enum type with notifications/events.
237 description: List of commands
241 additionalProperties: False
242 required: [ name, doc ]
245 description: Name of the operation, also defining its C enum value in uAPI.
248 description: Documentation for the command.
251 description: Value for the enum in the uAPI.
255 Attribute space from which attributes directly in the requests and replies
256 to this command are defined.
259 description: Command flags.
264 description: Kernel attribute validation flags.
267 enum: [ strict, dump ]
269 description: Main command handler.
271 additionalProperties: False
273 request: &subop-attr-list
274 description: Definition of the request message for a given command.
276 additionalProperties: False
280 Names of attributes from the attribute-set (not full attribute
281 definitions, just names).
285 reply: *subop-attr-list
287 description: Hook for a function to run before the main callback (pre_doit or start).
290 description: Hook for a function to run after the main callback (post_doit or done).
294 description: Name of the command sharing the reply type with this notification.
298 additionalProperties: False
301 description: Explicit list of the attributes for the notification.
306 description: Name of the multicast group generating given notification.
309 description: List of multicast groups.
312 additionalProperties: False
315 description: List of groups.
320 additionalProperties: False
324 The name for the group, used to form the define and the value of the define.
328 description: Override for the name of the define in C uAPI.