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)?$
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, genetlink-legacy ] # Trim
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.
50 # Start genetlink-legacy
53 Defines if the input policy in the kernel is global, per-operation, or split per operation type.
55 enum: [ split, per-op, global ]
56 # End genetlink-legacy
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, struct ] # Trim
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.
110 # Start genetlink-legacy
112 description: List of struct members. Only scalars and strings members allowed.
116 required: [ name, type ]
117 additionalProperties: False
122 description: The netlink attribute type
123 enum: [ u8, u16, u32, u64, s8, s16, s32, s64, string, binary ]
125 $ref: '#/$defs/len-or-define'
127 enum: [ little-endian, big-endian ]
129 description: Documentation for the struct member attribute.
132 description: Name of the enum type used for the attribute.
134 display-hint: &display-hint
136 Optional format indicator that is intended only for choosing
137 the right formatting mechanism when displaying values of this
139 enum: [ hex, mac, fddi, ipv4, ipv6, uuid ]
140 # End genetlink-legacy
143 description: Definition of attribute spaces for this family.
146 description: Definition of a single attribute space.
148 required: [ name, attributes ]
149 additionalProperties: False
153 Name used when referring to this space in other definitions, not used outside of the spec.
157 Prefix for the C enum name of the attributes. Default family[name]-set[name]-a-
160 description: Name for the enum type of the attribute.
163 description: Documentation of the space.
167 Name of another space which this is a logical part of. Sub-spaces can be used to define
168 a limited group of attributes which are used in a nest.
172 description: The explicit name for constant holding the count of attributes (last attr + 1).
175 description: The explicit name for last member of attribute enum.
179 description: List of attributes in the space.
183 required: [ name, type ]
184 additionalProperties: False
189 description: The netlink attribute type
190 enum: [ unused, pad, flag, binary, u8, u16, u32, u64, s32, s64,
191 string, nest, array-nest, nest-type-value ]
193 description: Documentation of the attribute.
196 description: Value for the enum item representing this attribute in the uAPI.
199 description: Name of the value extracted from the type of a nest-type-value attribute.
204 enum: [ little-endian, big-endian ]
208 description: Name of the space (sub-space) used inside the attribute.
211 description: Name of the enum type used for the attribute.
215 Treat the enum as flags. In most cases enum is either used as flags or as values.
216 Sometimes, however, both forms are necessary, in which case header contains the enum
217 form while specific attributes may request to convert the values into a bitfield.
220 description: Kernel input validation.
222 additionalProperties: False
225 description: Name of the flags constant on which to base mask (unsigned scalar types only).
228 description: Min value for an integer attribute.
231 description: Min length for a binary attribute.
232 $ref: '#/$defs/len-or-define'
234 description: Max length for a string or a binary attribute.
235 $ref: '#/$defs/len-or-define'
237 display-hint: *display-hint
242 # Start genetlink-legacy
244 description: Name of the struct type used for the attribute.
246 # End genetlink-legacy
248 # Make sure name-prefix does not appear in subsets (subsets inherit naming)
252 required: [ subset-of ]
255 required: [ name-prefix ]
258 description: Operations supported by the protocol.
261 additionalProperties: False
265 The model of assigning values to the operations.
266 "unified" is the recommended model where all message types belong
268 "directional" has the messages sent to the kernel and from the kernel
269 enumerated separately.
270 enum: [ unified, directional ] # Trim
273 Prefix for the C enum name of the command. The name is formed by concatenating
274 the prefix with the upper case name of the command, with dashes replaced by underscores.
277 description: Name for the enum type with commands.
280 description: Same as name-prefix but used to render notifications and events to separate enum.
283 description: Name for the enum type with notifications/events.
285 # Start genetlink-legacy
286 fixed-header: &fixed-header
288 Name of the structure defining the optional fixed-length protocol
289 header. This header is placed in a message after the netlink and
290 genetlink headers and before any attributes.
292 # End genetlink-legacy
294 description: List of commands
298 additionalProperties: False
299 required: [ name, doc ]
302 description: Name of the operation, also defining its C enum value in uAPI.
305 description: Documentation for the command.
308 description: Value for the enum in the uAPI.
312 Attribute space from which attributes directly in the requests and replies
313 to this command are defined.
316 description: Command flags.
321 description: Kernel attribute validation flags.
324 enum: [ strict, dump ]
325 # Start genetlink-legacy
326 fixed-header: *fixed-header
327 # End genetlink-legacy
329 description: Main command handler.
331 additionalProperties: False
333 request: &subop-attr-list
334 description: Definition of the request message for a given command.
336 additionalProperties: False
340 Names of attributes from the attribute-set (not full attribute
341 definitions, just names).
345 # Start genetlink-legacy
348 ID of this message if value for request and response differ,
349 i.e. requests and responses have different message enums.
351 # End genetlink-legacy
352 reply: *subop-attr-list
354 description: Hook for a function to run before the main callback (pre_doit or start).
357 description: Hook for a function to run after the main callback (post_doit or done).
361 description: Name of the command sharing the reply type with this notification.
365 additionalProperties: False
368 description: Explicit list of the attributes for the notification.
373 description: Name of the multicast group generating given notification.
376 description: List of multicast groups.
379 additionalProperties: False
382 description: List of groups.
387 additionalProperties: False
391 The name for the group, used to form the define and the value of the define.
395 description: Override for the name of the define in C uAPI.