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 version 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'
198 display-hint: &display-hint
200 Optional format indicator that is intended only for choosing
201 the right formatting mechanism when displaying values of this
203 enum: [ hex, mac, fddi, ipv4, ipv6, uuid ]
209 # Make sure name-prefix does not appear in subsets (subsets inherit naming)
213 required: [ subset-of ]
216 required: [ name-prefix ]
219 description: Operations supported by the protocol.
222 additionalProperties: False
226 The model of assigning values to the operations.
227 "unified" is the recommended model where all message types belong
229 "directional" has the messages sent to the kernel and from the kernel
230 enumerated separately.
234 Prefix for the C enum name of the command. The name is formed by concatenating
235 the prefix with the upper case name of the command, with dashes replaced by underscores.
238 description: Name for the enum type with commands.
241 description: Same as name-prefix but used to render notifications and events to separate enum.
244 description: Name for the enum type with notifications/events.
247 description: List of commands
251 additionalProperties: False
252 required: [ name, doc ]
255 description: Name of the operation, also defining its C enum value in uAPI.
258 description: Documentation for the command.
261 description: Value for the enum in the uAPI.
265 Attribute space from which attributes directly in the requests and replies
266 to this command are defined.
269 description: Command flags.
274 description: Kernel attribute validation flags.
277 enum: [ strict, dump, dump-strict ]
279 description: Main command handler.
281 additionalProperties: False
283 request: &subop-attr-list
284 description: Definition of the request message for a given command.
286 additionalProperties: False
290 Names of attributes from the attribute-set (not full attribute
291 definitions, just names).
295 reply: *subop-attr-list
297 description: Hook for a function to run before the main callback (pre_doit or start).
300 description: Hook for a function to run after the main callback (post_doit or done).
304 description: Name of the command sharing the reply type with this notification.
308 additionalProperties: False
311 description: Explicit list of the attributes for the notification.
316 description: Name of the multicast group generating given notification.
319 description: List of multicast groups.
322 additionalProperties: False
325 description: List of groups.
330 additionalProperties: False
334 The name for the group, used to form the define and the value of the define.
338 description: Override for the name of the define in C uAPI.