1 # SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)
4 $id: http://kernel.org/schemas/netlink/genetlink-legacy.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".
38 description: Path to the uAPI header, default is linux/${family-name}.h
42 description: List of type and constant definitions (enums, flags, defines).
46 required: [ type, name ]
47 additionalProperties: False
52 description: For C-compatible languages, header which already defines this value.
55 enum: [ const, enum, flags ]
60 description: For const - the value.
61 type: [ string, integer ]
64 description: For enum or flags the literal initializer for the first value.
65 type: [ string, integer ]
67 description: For enum or flags array of values.
74 additionalProperties: False
83 description: Render the max members for this enum.
87 description: Definition of attribute spaces for this family.
90 description: Definition of a single attribute space.
92 required: [ name, attributes ]
93 additionalProperties: False
97 Name used when referring to this space in other definitions, not used outside of the spec.
101 Prefix for the C enum name of the attributes. Default family[name]-set[name]-a-
104 description: Name for the enum type of the attribute.
107 description: Documentation of the space.
111 Name of another space which this is a logical part of. Sub-spaces can be used to define
112 a limited group of attributes which are used in a nest.
115 description: List of attributes in the space.
120 additionalProperties: False
125 enum: [ unused, pad, flag, binary,
126 uint, sint, u8, u16, u32, u64, s32, s64,
127 string, nest, indexed-array, nest-type-value ]
129 description: Documentation of the attribute.
132 description: Value for the enum item representing this attribute in the uAPI.
135 description: Name of the value extracted from the type of a nest-type-value attribute.
140 enum: [ little-endian, big-endian ]
144 description: Name of the space (sub-space) used inside the attribute.
147 description: Name of the enum type used for the attribute.
151 Treat the enum as flags. In most cases enum is either used as flags or as values.
152 Sometimes, however, both forms are necessary, in which case header contains the enum
153 form while specific attributes may request to convert the values into a bitfield.
156 description: Kernel input validation.
158 additionalProperties: False
161 description: Name of the flags constant on which to base mask (unsigned scalar types only).
164 description: Min value for an integer attribute.
165 $ref: '#/$defs/len-or-limit'
167 description: Max value for an integer attribute.
168 $ref: '#/$defs/len-or-limit'
170 description: Min length for a binary attribute.
171 $ref: '#/$defs/len-or-define'
173 description: Max length for a string or a binary attribute.
174 $ref: '#/$defs/len-or-define'
176 description: Exact length for a string or a binary attribute.
177 $ref: '#/$defs/len-or-define'
179 display-hint: &display-hint
181 Optional format indicator that is intended only for choosing
182 the right formatting mechanism when displaying values of this
184 enum: [ hex, mac, fddi, ipv4, ipv6, uuid ]
186 # Make sure name-prefix does not appear in subsets (subsets inherit naming)
190 required: [ subset-of ]
193 required: [ name-prefix ]
195 # type property is only required if not in subset definition
208 description: Operations supported by the protocol.
211 additionalProperties: False
215 The model of assigning values to the operations.
216 "unified" is the recommended model where all message types belong
218 "directional" has the messages sent to the kernel and from the kernel
219 enumerated separately.
223 Prefix for the C enum name of the command. The name is formed by concatenating
224 the prefix with the upper case name of the command, with dashes replaced by underscores.
227 description: Name for the enum type with commands.
230 description: Same as name-prefix but used to render notifications and events to separate enum.
233 description: Name for the enum type with notifications/events.
236 description: List of commands
240 additionalProperties: False
241 required: [ name, doc ]
244 description: Name of the operation, also defining its C enum value in uAPI.
247 description: Documentation for the command.
250 description: Value for the enum in the uAPI.
254 Attribute space from which attributes directly in the requests and replies
255 to this command are defined.
258 description: Command flags.
263 description: Kernel attribute validation flags.
266 enum: [ strict, dump, dump-strict ]
269 Name of the kernel config option gating the presence of
270 the operation, without the 'CONFIG_' prefix.
273 description: Main command handler.
275 additionalProperties: False
277 request: &subop-attr-list
278 description: Definition of the request message for a given command.
280 additionalProperties: False
284 Names of attributes from the attribute-set (not full attribute
285 definitions, just names).
289 reply: *subop-attr-list
291 description: Hook for a function to run before the main callback (pre_doit or start).
294 description: Hook for a function to run after the main callback (post_doit or done).
298 description: Name of the command sharing the reply type with this notification.
302 additionalProperties: False
305 description: Explicit list of the attributes for the notification.
310 description: Name of the multicast group generating given notification.
313 description: List of multicast groups.
316 additionalProperties: False
319 description: List of groups.
324 additionalProperties: False
328 The name for the group, used to form the define and the value of the define.
333 description: Additional global attributes used for kernel C code generation.
335 additionalProperties: False
339 List of extra headers which should be included in the source
340 of the generated code.
346 Literal name of the type which is used within the kernel
347 to store the socket state. The type / structure is internal
348 to the kernel, and is not defined in the spec.