Resguardo inicial

This commit is contained in:
lastdragon
2026-09-06 12:53:21 -06:00
parent 662efe3c2a
commit ad2088d178
94853 changed files with 43200404 additions and 0 deletions
@@ -0,0 +1,415 @@
# SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)
%YAML 1.2
---
$id: http://kernel.org/schemas/netlink/genetlink-c.yaml#
$schema: https://json-schema.org/draft-07/schema
# Common defines
$defs:
uint:
type: integer
minimum: 0
len-or-define:
type: [ string, integer ]
pattern: ^[0-9A-Za-z_-]+( - 1)?$
minimum: 0
len-or-limit:
# literal int, const name, or limit based on fixed-width type
# e.g. u8-min, u16-max, etc.
type: [ string, integer ]
pattern: ^[0-9A-Za-z_-]+$
minimum: 0
# Schema for specs
title: Protocol
description: Specification of a genetlink protocol
type: object
required: [ name, doc, attribute-sets, operations ]
additionalProperties: False
properties:
name:
description: Name of the genetlink family.
type: string
doc:
type: string
protocol:
description: Schema compatibility level. Default is "genetlink".
enum: [ genetlink, genetlink-c ]
uapi-header:
description: Path to the uAPI header, default is linux/${family-name}.h
type: string
# Start genetlink-c
c-family-name:
description: Name of the define for the family name.
type: string
c-version-name:
description: Name of the define for the version of the family.
type: string
max-by-define:
description: Makes the number of attributes and commands be specified by a define, not an enum value.
type: boolean
cmd-max-name:
description: Name of the define for the last operation in the list.
type: string
cmd-cnt-name:
description: The explicit name for constant holding the count of operations (last operation + 1).
type: string
# End genetlink-c
definitions:
description: List of type and constant definitions (enums, flags, defines).
type: array
items:
type: object
required: [ type, name ]
additionalProperties: False
properties:
name:
type: string
header:
description: For C-compatible languages, header which already defines this value.
type: string
scope:
description: |
Visibility of this definition. "uapi" (default) renders into
the uAPI header, "kernel" renders into the kernel-side
generated header, "user" renders into the user-side
generated header. When combined with `header:`, the
definition is not rendered, and the named header is
included only by code matching the scope.
enum: [ uapi, kernel, user ]
type:
enum: [ const, enum, flags ]
doc:
type: string
# For const
value:
description: For const - the value.
type: [ string, integer ]
# For enum and flags
value-start:
description: For enum or flags the literal initializer for the first value.
type: [ string, integer ]
entries:
description: For enum or flags array of values.
type: array
items:
oneOf:
- type: string
- type: object
required: [ name ]
additionalProperties: False
properties:
name:
type: string
value:
type: integer
doc:
type: string
render-max:
description: Render the max members for this enum.
type: boolean
# Start genetlink-c
enum-name:
description: Name for enum, if empty no name will be used.
type: [ string, "null" ]
name-prefix:
description: For enum the prefix of the values, optional.
type: string
enum-cnt-name:
description: Name of the render-max counter enum entry.
type: string
# End genetlink-c
attribute-sets:
description: Definition of attribute spaces for this family.
type: array
items:
description: Definition of a single attribute space.
type: object
required: [ name, attributes ]
additionalProperties: False
properties:
name:
description: |
Name used when referring to this space in other definitions, not used outside of the spec.
type: string
name-prefix:
description: |
Prefix for the C enum name of the attributes. Default family[name]-set[name]-a-
type: string
enum-name:
description: |
Name for the enum type of the attribute, if empty no name will be used.
type: [ string, "null" ]
doc:
description: Documentation of the space.
type: string
subset-of:
description: |
Name of another space which this is a logical part of. Sub-spaces can be used to define
a limited group of attributes which are used in a nest.
type: string
# Start genetlink-c
attr-cnt-name:
description: The explicit name for constant holding the count of attributes (last attr + 1).
type: string
attr-max-name:
description: The explicit name for last member of attribute enum.
type: string
header:
description: For C-compatible languages, header which already defines this attribute set.
type: string
# End genetlink-c
attributes:
description: List of attributes in the space.
type: array
items:
type: object
required: [ name ]
additionalProperties: False
properties:
name:
type: string
type: &attr-type
enum: [ unused, pad, flag, binary,
uint, sint, u8, u16, u32, u64, s8, s16, s32, s64,
string, nest, indexed-array, nest-type-value ]
doc:
description: Documentation of the attribute.
type: string
value:
description: Value for the enum item representing this attribute in the uAPI.
$ref: '#/$defs/uint'
type-value:
description: Name of the value extracted from the type of a nest-type-value attribute.
type: array
items:
type: string
byte-order:
enum: [ little-endian, big-endian ]
multi-attr:
type: boolean
nested-attributes:
description: Name of the space (sub-space) used inside the attribute.
type: string
enum:
description: Name of the enum type used for the attribute.
type: string
enum-as-flags:
description: |
Treat the enum as flags. In most cases enum is either used as flags or as values.
Sometimes, however, both forms are necessary, in which case header contains the enum
form while specific attributes may request to convert the values into a bitfield.
type: boolean
checks:
description: Kernel input validation.
type: object
additionalProperties: False
properties:
flags-mask:
description: Name of the flags constant on which to base mask (unsigned scalar types only).
type: string
min:
description: Min value for an integer attribute.
$ref: '#/$defs/len-or-limit'
max:
description: Max value for an integer attribute.
$ref: '#/$defs/len-or-limit'
min-len:
description: Min length for a binary attribute.
$ref: '#/$defs/len-or-define'
max-len:
description: Max length for a string or a binary attribute.
$ref: '#/$defs/len-or-define'
exact-len:
description: Exact length for a string or a binary attribute.
$ref: '#/$defs/len-or-define'
unterminated-ok:
description: |
For string attributes, do not check whether attribute
contains the terminating null character.
type: boolean
sub-type: *attr-type
display-hint: &display-hint
description: |
Optional format indicator that is intended only for choosing
the right formatting mechanism when displaying values of this
type.
enum: [ hex, mac, fddi, ipv4, ipv6, ipv4-or-v6, uuid ]
# Start genetlink-c
name-prefix:
type: string
# End genetlink-c
# Make sure name-prefix does not appear in subsets (subsets inherit naming)
dependencies:
name-prefix:
not:
required: [ subset-of ]
subset-of:
not:
required: [ name-prefix ]
# type property is only required if not in subset definition
if:
properties:
subset-of:
not:
type: string
then:
properties:
attributes:
items:
required: [ type ]
operations:
description: Operations supported by the protocol.
type: object
required: [ list ]
additionalProperties: False
properties:
enum-model:
description: |
The model of assigning values to the operations.
"unified" is the recommended model where all message types belong
to a single enum.
"directional" has the messages sent to the kernel and from the kernel
enumerated separately.
enum: [ unified ]
name-prefix:
description: |
Prefix for the C enum name of the command. The name is formed by concatenating
the prefix with the upper case name of the command, with dashes replaced by underscores.
type: string
enum-name:
description: |
Name for the enum type with commands, if empty no name will be used.
type: [ string, "null" ]
async-prefix:
description: Same as name-prefix but used to render notifications and events to separate enum.
type: string
async-enum:
description: |
Name for the enum type with commands, if empty no name will be used.
type: [ string, "null" ]
list:
description: List of commands
type: array
items:
type: object
additionalProperties: False
required: [ name, doc ]
properties:
name:
description: Name of the operation, also defining its C enum value in uAPI.
type: string
doc:
description: Documentation for the command.
type: string
value:
description: Value for the enum in the uAPI.
$ref: '#/$defs/uint'
attribute-set:
description: |
Attribute space from which attributes directly in the requests and replies
to this command are defined.
type: string
flags: &cmd_flags
description: Command flags.
type: array
items:
enum: [ admin-perm ]
dont-validate:
description: Kernel attribute validation flags.
type: array
items:
enum: [ strict, dump, dump-strict ]
config-cond:
description: |
Name of the kernel config option gating the presence of
the operation, without the 'CONFIG_' prefix.
type: string
do: &subop-type
description: Main command handler.
type: object
additionalProperties: False
properties:
request: &subop-attr-list
description: Definition of the request message for a given command.
type: object
additionalProperties: False
properties:
attributes:
description: |
Names of attributes from the attribute-set (not full attribute
definitions, just names).
type: array
items:
type: string
reply: *subop-attr-list
pre:
description: Hook for a function to run before the main callback (pre_doit or start).
type: string
post:
description: Hook for a function to run after the main callback (post_doit or done).
type: string
dump: *subop-type
notify:
description: Name of the command sharing the reply type with this notification.
type: string
event:
type: object
additionalProperties: False
properties:
attributes:
description: Explicit list of the attributes for the notification.
type: array
items:
type: string
mcgrp:
description: Name of the multicast group generating given notification.
type: string
mcast-groups:
description: List of multicast groups.
type: object
required: [ list ]
additionalProperties: False
properties:
list:
description: List of groups.
type: array
items:
type: object
required: [ name ]
additionalProperties: False
properties:
name:
description: |
The name for the group, used to form the define and the value of the define.
type: string
# Start genetlink-c
c-define-name:
description: Override for the name of the define in C uAPI.
type: string
# End genetlink-c
flags: *cmd_flags
kernel-family:
description: Additional global attributes used for kernel C code generation.
type: object
additionalProperties: False
properties:
headers:
description: |
List of extra headers which should be included in the source
of the generated code.
type: array
items:
type: string
sock-priv:
description: |
Literal name of the type which is used within the kernel
to store the socket state. The type / structure is internal
to the kernel, and is not defined in the spec.
type: string
@@ -0,0 +1,482 @@
# SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)
%YAML 1.2
---
$id: http://kernel.org/schemas/netlink/genetlink-legacy.yaml#
$schema: https://json-schema.org/draft-07/schema
# Common defines
$defs:
name:
type: string
pattern: ^[0-9a-z-]+$
uint:
type: integer
minimum: 0
len-or-define:
type: [ string, integer ]
pattern: ^[0-9A-Za-z_-]+( - 1)?$
minimum: 0
len-or-limit:
# literal int, const name, or limit based on fixed-width type
# e.g. u8-min, u16-max, etc.
type: [ string, integer ]
pattern: ^[0-9A-Za-z_-]+$
minimum: 0
# Schema for specs
title: Protocol
description: Specification of a genetlink protocol
type: object
required: [ name, doc, attribute-sets, operations ]
additionalProperties: False
properties:
name:
description: Name of the genetlink family.
type: string
doc:
type: string
protocol:
description: Schema compatibility level. Default is "genetlink".
enum: [ genetlink, genetlink-c, genetlink-legacy ] # Trim
uapi-header:
description: Path to the uAPI header, default is linux/${family-name}.h
type: string
# Start genetlink-c
c-family-name:
description: Name of the define for the family name.
type: string
c-version-name:
description: Name of the define for the version of the family.
type: string
max-by-define:
description: Makes the number of attributes and commands be specified by a define, not an enum value.
type: boolean
cmd-max-name:
description: Name of the define for the last operation in the list.
type: string
cmd-cnt-name:
description: The explicit name for constant holding the count of operations (last operation + 1).
type: string
# End genetlink-c
# Start genetlink-legacy
kernel-policy:
description: |
Defines if the input policy in the kernel is global, per-operation, or split per operation type.
Default is split.
enum: [ split, per-op, global ]
version:
description: Generic Netlink family version. Default is 1.
type: integer
minimum: 1
# End genetlink-legacy
definitions:
description: List of type and constant definitions (enums, flags, defines).
type: array
items:
type: object
required: [ type, name ]
additionalProperties: False
properties:
name:
$ref: '#/$defs/name'
header:
description: For C-compatible languages, header which already defines this value.
type: string
scope:
description: |
Visibility of this definition. "uapi" (default) renders into
the uAPI header, "kernel" renders into the kernel-side
generated header, "user" renders into the user-side
generated header. When combined with `header:`, the
definition is not rendered, and the named header is
included only by code matching the scope.
enum: [ uapi, kernel, user ]
type:
enum: [ const, enum, flags, struct ] # Trim
doc:
type: string
# For const
value:
description: For const - the value.
type: [ string, integer ]
# For enum and flags
value-start:
description: For enum or flags the literal initializer for the first value.
type: [ string, integer ]
entries:
description: For enum or flags array of values.
type: array
items:
oneOf:
- type: string
- type: object
required: [ name ]
additionalProperties: False
properties:
name:
$ref: '#/$defs/name'
value:
type: integer
doc:
type: string
render-max:
description: Render the max members for this enum.
type: boolean
# Start genetlink-c
enum-name:
description: Name for enum, if empty no name will be used.
type: [ string, "null" ]
name-prefix:
description: For enum the prefix of the values, optional.
type: string
enum-cnt-name:
description: Name of the render-max counter enum entry.
type: string
# End genetlink-c
# Start genetlink-legacy
members:
description: List of struct members. Only scalars and strings members allowed.
type: array
items:
type: object
required: [ name, type ]
additionalProperties: False
properties:
name:
$ref: '#/$defs/name'
type:
description: The netlink attribute type
enum: [ u8, u16, u32, u64, s8, s16, s32, s64, string, binary ]
len:
$ref: '#/$defs/len-or-define'
byte-order:
enum: [ little-endian, big-endian ]
doc:
description: Documentation for the struct member attribute.
type: string
enum:
description: Name of the enum type used for the attribute.
type: string
display-hint: &display-hint
description: |
Optional format indicator that is intended only for choosing
the right formatting mechanism when displaying values of this
type.
enum: [ hex, mac, fddi, ipv4, ipv6, ipv4-or-v6, uuid ]
struct:
description: Name of the nested struct type.
type: string
# End genetlink-legacy
attribute-sets:
description: Definition of attribute spaces for this family.
type: array
items:
description: Definition of a single attribute space.
type: object
required: [ name, attributes ]
additionalProperties: False
properties:
name:
description: |
Name used when referring to this space in other definitions, not used outside of the spec.
$ref: '#/$defs/name'
name-prefix:
description: |
Prefix for the C enum name of the attributes. Default family[name]-set[name]-a-
type: string
enum-name:
description: |
Name for the enum type of the attribute, if empty no name will be used.
type: [ string, "null" ]
doc:
description: Documentation of the space.
type: string
subset-of:
description: |
Name of another space which this is a logical part of. Sub-spaces can be used to define
a limited group of attributes which are used in a nest.
type: string
# Start genetlink-c
attr-cnt-name:
description: The explicit name for constant holding the count of attributes (last attr + 1).
type: string
attr-max-name:
description: The explicit name for last member of attribute enum.
type: string
header:
description: For C-compatible languages, header which already defines this attribute set.
type: string
# End genetlink-c
attributes:
description: List of attributes in the space.
type: array
items:
type: object
required: [ name ]
additionalProperties: False
properties:
name:
$ref: '#/$defs/name'
type: &attr-type
description: The netlink attribute type
enum: [ unused, pad, flag, binary, bitfield32,
uint, sint, u8, u16, u32, u64, s8, s16, s32, s64,
string, nest, indexed-array, nest-type-value ]
doc:
description: Documentation of the attribute.
type: string
value:
description: Value for the enum item representing this attribute in the uAPI.
$ref: '#/$defs/uint'
type-value:
description: Name of the value extracted from the type of a nest-type-value attribute.
type: array
items:
type: string
byte-order:
enum: [ little-endian, big-endian ]
multi-attr:
type: boolean
nested-attributes:
description: Name of the space (sub-space) used inside the attribute.
type: string
enum:
description: Name of the enum type used for the attribute.
type: string
enum-as-flags:
description: |
Treat the enum as flags. In most cases enum is either used as flags or as values.
Sometimes, however, both forms are necessary, in which case header contains the enum
form while specific attributes may request to convert the values into a bitfield.
type: boolean
checks:
description: Kernel input validation.
type: object
additionalProperties: False
properties:
flags-mask:
description: Name of the flags constant on which to base mask (unsigned scalar types only).
type: string
min:
description: Min value for an integer attribute.
$ref: '#/$defs/len-or-limit'
max:
description: Max value for an integer attribute.
$ref: '#/$defs/len-or-limit'
min-len:
description: Min length for a binary attribute.
$ref: '#/$defs/len-or-define'
max-len:
description: Max length for a string or a binary attribute.
$ref: '#/$defs/len-or-define'
exact-len:
description: Exact length for a string or a binary attribute.
$ref: '#/$defs/len-or-define'
unterminated-ok:
description: |
For string attributes, do not check whether attribute
contains the terminating null character.
type: boolean
sub-type: *attr-type
display-hint: *display-hint
# Start genetlink-c
name-prefix:
type: string
# End genetlink-c
# Start genetlink-legacy
struct:
description: Name of the struct type used for the attribute.
type: string
# End genetlink-legacy
# Make sure name-prefix does not appear in subsets (subsets inherit naming)
dependencies:
name-prefix:
not:
required: [ subset-of ]
subset-of:
not:
required: [ name-prefix ]
# type property is only required if not in subset definition
if:
properties:
subset-of:
not:
type: string
then:
properties:
attributes:
items:
required: [ type ]
operations:
description: Operations supported by the protocol.
type: object
required: [ list ]
additionalProperties: False
properties:
enum-model:
description: |
The model of assigning values to the operations.
"unified" is the recommended model where all message types belong
to a single enum.
"directional" has the messages sent to the kernel and from the kernel
enumerated separately.
enum: [ unified, directional ] # Trim
name-prefix:
description: |
Prefix for the C enum name of the command. The name is formed by concatenating
the prefix with the upper case name of the command, with dashes replaced by underscores.
type: string
enum-name:
description: |
Name for the enum type with commands, if empty no name will be used.
type: [ string, "null" ]
async-prefix:
description: Same as name-prefix but used to render notifications and events to separate enum.
type: string
async-enum:
description: |
Name for the enum type with commands, if empty no name will be used.
type: [ string, "null" ]
# Start genetlink-legacy
fixed-header: &fixed-header
description: |
Name of the structure defining the optional fixed-length protocol
header. This header is placed in a message after the netlink and
genetlink headers and before any attributes.
type: string
# End genetlink-legacy
list:
description: List of commands
type: array
items:
type: object
additionalProperties: False
required: [ name, doc ]
properties:
name:
description: Name of the operation, also defining its C enum value in uAPI.
$ref: '#/$defs/name'
doc:
description: Documentation for the command.
type: string
value:
description: Value for the enum in the uAPI.
$ref: '#/$defs/uint'
attribute-set:
description: |
Attribute space from which attributes directly in the requests and replies
to this command are defined.
type: string
flags: &cmd_flags
description: Command flags.
type: array
items:
enum: [ admin-perm, uns-admin-perm ]
dont-validate:
description: Kernel attribute validation flags.
type: array
items:
enum: [ strict, dump, dump-strict ]
config-cond:
description: |
Name of the kernel config option gating the presence of
the operation, without the 'CONFIG_' prefix.
type: string
# Start genetlink-legacy
fixed-header: *fixed-header
# End genetlink-legacy
do: &subop-type
description: Main command handler.
type: object
additionalProperties: False
properties:
request: &subop-attr-list
description: Definition of the request message for a given command.
type: object
additionalProperties: False
properties:
attributes:
description: |
Names of attributes from the attribute-set (not full attribute
definitions, just names).
type: array
items:
type: string
# Start genetlink-legacy
value:
description: |
ID of this message if value for request and response differ,
i.e. requests and responses have different message enums.
$ref: '#/$defs/uint'
# End genetlink-legacy
reply: *subop-attr-list
pre:
description: Hook for a function to run before the main callback (pre_doit or start).
type: string
post:
description: Hook for a function to run after the main callback (post_doit or done).
type: string
dump: *subop-type
notify:
description: Name of the command sharing the reply type with this notification.
type: string
event:
type: object
additionalProperties: False
properties:
attributes:
description: Explicit list of the attributes for the notification.
type: array
items:
type: string
mcgrp:
description: Name of the multicast group generating given notification.
type: string
mcast-groups:
description: List of multicast groups.
type: object
required: [ list ]
additionalProperties: False
properties:
list:
description: List of groups.
type: array
items:
type: object
required: [ name ]
additionalProperties: False
properties:
name:
description: |
The name for the group, used to form the define and the value of the define.
type: string
# Start genetlink-c
c-define-name:
description: Override for the name of the define in C uAPI.
type: string
# End genetlink-c
flags: *cmd_flags
kernel-family:
description: Additional global attributes used for kernel C code generation.
type: object
additionalProperties: False
properties:
headers:
description: |
List of extra headers which should be included in the source
of the generated code.
type: array
items:
type: string
sock-priv:
description: |
Literal name of the type which is used within the kernel
to store the socket state. The type / structure is internal
to the kernel, and is not defined in the spec.
type: string
@@ -0,0 +1,362 @@
# SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)
%YAML 1.2
---
$id: http://kernel.org/schemas/netlink/genetlink-legacy.yaml#
$schema: https://json-schema.org/draft-07/schema
# Common defines
$defs:
name:
type: string
pattern: ^[0-9a-z-]+$
uint:
type: integer
minimum: 0
len-or-define:
type: [ string, integer ]
pattern: ^[0-9A-Za-z_-]+( - 1)?$
minimum: 0
len-or-limit:
# literal int, const name, or limit based on fixed-width type
# e.g. u8-min, u16-max, etc.
type: [ string, integer ]
pattern: ^[0-9A-Za-z_-]+$
minimum: 0
# Schema for specs
title: Protocol
description: Specification of a genetlink protocol
type: object
required: [ name, doc, attribute-sets, operations ]
additionalProperties: False
properties:
name:
description: Name of the genetlink family.
$ref: '#/$defs/name'
doc:
type: string
protocol:
description: Schema compatibility level. Default is "genetlink".
enum: [ genetlink ]
uapi-header:
description: Path to the uAPI header, default is linux/${family-name}.h
type: string
definitions:
description: List of type and constant definitions (enums, flags, defines).
type: array
items:
type: object
required: [ type, name ]
additionalProperties: False
properties:
name:
$ref: '#/$defs/name'
header:
description: For C-compatible languages, header which already defines this value.
type: string
scope:
description: |
Visibility of this definition. "uapi" (default) renders into
the uAPI header, "kernel" renders into the kernel-side
generated header, "user" renders into the user-side
generated header. When combined with `header:`, the
definition is not rendered, and the named header is
included only by code matching the scope.
enum: [ uapi, kernel, user ]
type:
enum: [ const, enum, flags ]
doc:
type: string
# For const
value:
description: For const - the value.
type: [ string, integer ]
# For enum and flags
value-start:
description: For enum or flags the literal initializer for the first value.
type: [ string, integer ]
entries:
description: For enum or flags array of values.
type: array
items:
oneOf:
- type: string
- type: object
required: [ name ]
additionalProperties: False
properties:
name:
$ref: '#/$defs/name'
value:
type: integer
doc:
type: string
render-max:
description: Render the max members for this enum.
type: boolean
attribute-sets:
description: Definition of attribute spaces for this family.
type: array
items:
description: Definition of a single attribute space.
type: object
required: [ name, attributes ]
additionalProperties: False
properties:
name:
description: |
Name used when referring to this space in other definitions, not used outside of the spec.
$ref: '#/$defs/name'
name-prefix:
description: |
Prefix for the C enum name of the attributes. Default family[name]-set[name]-a-
type: string
enum-name:
description: Name for the enum type of the attribute.
type: string
doc:
description: Documentation of the space.
type: string
subset-of:
description: |
Name of another space which this is a logical part of. Sub-spaces can be used to define
a limited group of attributes which are used in a nest.
type: string
attributes:
description: List of attributes in the space.
type: array
items:
type: object
required: [ name ]
additionalProperties: False
properties:
name:
$ref: '#/$defs/name'
type: &attr-type
enum: [ unused, pad, flag, binary,
uint, sint, u8, u16, u32, u64, s8, s16, s32, s64,
string, nest, indexed-array, nest-type-value ]
doc:
description: Documentation of the attribute.
type: string
value:
description: Value for the enum item representing this attribute in the uAPI.
$ref: '#/$defs/uint'
type-value:
description: Name of the value extracted from the type of a nest-type-value attribute.
type: array
items:
type: string
byte-order:
enum: [ little-endian, big-endian ]
multi-attr:
type: boolean
nested-attributes:
description: Name of the space (sub-space) used inside the attribute.
type: string
enum:
description: Name of the enum type used for the attribute.
type: string
enum-as-flags:
description: |
Treat the enum as flags. In most cases enum is either used as flags or as values.
Sometimes, however, both forms are necessary, in which case header contains the enum
form while specific attributes may request to convert the values into a bitfield.
type: boolean
checks:
description: Kernel input validation.
type: object
additionalProperties: False
properties:
flags-mask:
description: Name of the flags constant on which to base mask (unsigned scalar types only).
type: string
min:
description: Min value for an integer attribute.
$ref: '#/$defs/len-or-limit'
max:
description: Max value for an integer attribute.
$ref: '#/$defs/len-or-limit'
min-len:
description: Min length for a binary attribute.
$ref: '#/$defs/len-or-define'
max-len:
description: Max length for a string or a binary attribute.
$ref: '#/$defs/len-or-define'
exact-len:
description: Exact length for a string or a binary attribute.
$ref: '#/$defs/len-or-define'
sub-type: *attr-type
display-hint: &display-hint
description: |
Optional format indicator that is intended only for choosing
the right formatting mechanism when displaying values of this
type.
enum: [ hex, mac, fddi, ipv4, ipv6, ipv4-or-v6, uuid ]
# Make sure name-prefix does not appear in subsets (subsets inherit naming)
dependencies:
name-prefix:
not:
required: [ subset-of ]
subset-of:
not:
required: [ name-prefix ]
# type property is only required if not in subset definition
if:
properties:
subset-of:
not:
type: string
then:
properties:
attributes:
items:
required: [ type ]
operations:
description: Operations supported by the protocol.
type: object
required: [ list ]
additionalProperties: False
properties:
enum-model:
description: |
The model of assigning values to the operations.
"unified" is the recommended model where all message types belong
to a single enum.
"directional" has the messages sent to the kernel and from the kernel
enumerated separately.
enum: [ unified ]
name-prefix:
description: |
Prefix for the C enum name of the command. The name is formed by concatenating
the prefix with the upper case name of the command, with dashes replaced by underscores.
type: string
enum-name:
description: Name for the enum type with commands.
type: string
async-prefix:
description: Same as name-prefix but used to render notifications and events to separate enum.
type: string
async-enum:
description: Name for the enum type with notifications/events.
type: string
list:
description: List of commands
type: array
items:
type: object
additionalProperties: False
required: [ name, doc ]
properties:
name:
description: Name of the operation, also defining its C enum value in uAPI.
$ref: '#/$defs/name'
doc:
description: Documentation for the command.
type: string
value:
description: Value for the enum in the uAPI.
$ref: '#/$defs/uint'
attribute-set:
description: |
Attribute space from which attributes directly in the requests and replies
to this command are defined.
type: string
flags: &cmd_flags
description: Command flags.
type: array
items:
enum: [ admin-perm, uns-admin-perm ]
dont-validate:
description: Kernel attribute validation flags.
type: array
items:
enum: [ strict, dump, dump-strict ]
config-cond:
description: |
Name of the kernel config option gating the presence of
the operation, without the 'CONFIG_' prefix.
type: string
do: &subop-type
description: Main command handler.
type: object
additionalProperties: False
properties:
request: &subop-attr-list
description: Definition of the request message for a given command.
type: object
additionalProperties: False
properties:
attributes:
description: |
Names of attributes from the attribute-set (not full attribute
definitions, just names).
type: array
items:
type: string
reply: *subop-attr-list
pre:
description: Hook for a function to run before the main callback (pre_doit or start).
type: string
post:
description: Hook for a function to run after the main callback (post_doit or done).
type: string
dump: *subop-type
notify:
description: Name of the command sharing the reply type with this notification.
type: string
event:
type: object
additionalProperties: False
properties:
attributes:
description: Explicit list of the attributes for the notification.
type: array
items:
type: string
mcgrp:
description: Name of the multicast group generating given notification.
type: string
mcast-groups:
description: List of multicast groups.
type: object
required: [ list ]
additionalProperties: False
properties:
list:
description: List of groups.
type: array
items:
type: object
required: [ name ]
additionalProperties: False
properties:
name:
description: |
The name for the group, used to form the define and the value of the define.
$ref: '#/$defs/name'
flags: *cmd_flags
kernel-family:
description: Additional global attributes used for kernel C code generation.
type: object
additionalProperties: False
properties:
headers:
description: |
List of extra headers which should be included in the source
of the generated code.
type: array
items:
type: string
sock-priv:
description: |
Literal name of the type which is used within the kernel
to store the socket state. The type / structure is internal
to the kernel, and is not defined in the spec.
type: string
@@ -0,0 +1,535 @@
# SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)
%YAML 1.2
---
$id: http://kernel.org/schemas/netlink/netlink-raw.yaml#
$schema: https://json-schema.org/draft-07/schema
# Common defines
$defs:
name:
type: string
pattern: ^[0-9a-z-]+$
name-cap:
type: string
pattern: ^[0-9a-zA-Z-]+$
uint:
type: integer
minimum: 0
len-or-define:
type: [ string, integer ]
pattern: ^[0-9A-Za-z_-]+( - 1)?$
minimum: 0
len-or-limit:
# literal int, const name, or limit based on fixed-width type
# e.g. u8-min, u16-max, etc.
type: [ string, integer ]
pattern: ^[0-9A-Za-z_-]+$
minimum: 0
# Schema for specs
title: Protocol
description: Specification of a raw netlink protocol
type: object
required: [ name, doc, attribute-sets, operations ]
additionalProperties: False
properties:
name:
description: Name of the netlink family.
type: string
doc:
type: string
protocol:
description: Schema compatibility level.
enum: [ netlink-raw ] # Trim
# Start netlink-raw
protonum:
description: Protocol number to use for netlink-raw
type: integer
# End netlink-raw
uapi-header:
description: Path to the uAPI header, default is linux/${family-name}.h
type: string
# Start genetlink-c
c-family-name:
description: Name of the define for the family name.
type: string
c-version-name:
description: Name of the define for the version of the family.
type: string
max-by-define:
description: Makes the number of attributes and commands be specified by a define, not an enum value.
type: boolean
cmd-max-name:
description: Name of the define for the last operation in the list.
type: string
cmd-cnt-name:
description: The explicit name for constant holding the count of operations (last operation + 1).
type: string
# End genetlink-c
# Start genetlink-legacy
kernel-policy:
description: |
Defines if the input policy in the kernel is global, per-operation, or split per operation type.
Default is split.
enum: [ split, per-op, global ]
# End genetlink-legacy
definitions:
description: List of type and constant definitions (enums, flags, defines).
type: array
items:
type: object
required: [ type, name ]
additionalProperties: False
properties:
name:
$ref: '#/$defs/name'
header:
description: For C-compatible languages, header which already defines this value.
type: string
scope:
description: |
Visibility of this definition. "uapi" (default) renders into
the uAPI header, "kernel" renders into the kernel-side
generated header, "user" renders into the user-side
generated header. When combined with `header:`, the
definition is not rendered, and the named header is
included only by code matching the scope.
enum: [ uapi, kernel, user ]
type:
enum: [ const, enum, flags, struct ] # Trim
doc:
type: string
# For const
value:
description: For const - the value.
type: [ string, integer ]
# For enum and flags
value-start:
description: For enum or flags the literal initializer for the first value.
type: [ string, integer ]
entries:
description: For enum or flags array of values.
type: array
items:
oneOf:
- type: string
- type: object
required: [ name ]
additionalProperties: False
properties:
name:
$ref: '#/$defs/name'
value:
type: integer
doc:
type: string
render-max:
description: Render the max members for this enum.
type: boolean
# Start genetlink-c
enum-name:
description: Name for enum, if empty no name will be used.
type: [ string, "null" ]
name-prefix:
description: For enum the prefix of the values, optional.
type: string
# End genetlink-c
# Start genetlink-legacy
members:
description: List of struct members. Only scalars and strings members allowed.
type: array
items:
type: object
required: [ name, type ]
additionalProperties: False
properties:
name:
$ref: '#/$defs/name-cap'
type:
description: |
The netlink attribute type. Members of type 'binary' or 'pad'
must also have the 'len' property set.
enum: [ u8, u16, u32, u64, s8, s16, s32, s64, string, binary, pad ]
len:
$ref: '#/$defs/len-or-define'
byte-order:
enum: [ little-endian, big-endian ]
doc:
description: Documentation for the struct member attribute.
type: string
enum:
description: Name of the enum type used for the attribute.
type: string
enum-as-flags:
description: |
Treat the enum as flags. In most cases enum is either used as flags or as values.
Sometimes, however, both forms are necessary, in which case header contains the enum
form while specific attributes may request to convert the values into a bitfield.
type: boolean
display-hint: &display-hint
description: |
Optional format indicator that is intended only for choosing
the right formatting mechanism when displaying values of this
type.
enum: [ hex, mac, fddi, ipv4, ipv6, ipv4-or-v6, uuid ]
struct:
description: Name of the nested struct type.
type: string
if:
properties:
type:
const: pad
then:
required: [ len ]
if:
properties:
type:
const: binary
then:
oneOf:
- required: [ len ]
- required: [ struct ]
# End genetlink-legacy
attribute-sets:
description: Definition of attribute spaces for this family.
type: array
items:
description: Definition of a single attribute space.
type: object
required: [ name, attributes ]
additionalProperties: False
properties:
name:
description: |
Name used when referring to this space in other definitions, not used outside of the spec.
$ref: '#/$defs/name'
name-prefix:
description: |
Prefix for the C enum name of the attributes. Default family[name]-set[name]-a-
type: string
enum-name:
description: |
Name for the enum type of the attribute, if empty no name will be used.
type: [ string, "null" ]
doc:
description: Documentation of the space.
type: string
subset-of:
description: |
Name of another space which this is a logical part of. Sub-spaces can be used to define
a limited group of attributes which are used in a nest.
type: string
# Start genetlink-c
attr-cnt-name:
description: The explicit name for constant holding the count of attributes (last attr + 1).
type: string
attr-max-name:
description: The explicit name for last member of attribute enum.
type: string
header:
description: For C-compatible languages, header which already defines this attribute set.
type: string
# End genetlink-c
attributes:
description: List of attributes in the space.
type: array
items:
type: object
required: [ name ]
additionalProperties: False
properties:
name:
$ref: '#/$defs/name'
type: &attr-type
description: The netlink attribute type
enum: [ unused, pad, flag, binary, bitfield32,
uint, sint, u8, u16, u32, u64, s8, s16, s32, s64,
string, nest, indexed-array, nest-type-value,
sub-message ]
doc:
description: Documentation of the attribute.
type: string
value:
description: Value for the enum item representing this attribute in the uAPI.
$ref: '#/$defs/uint'
type-value:
description: Name of the value extracted from the type of a nest-type-value attribute.
type: array
items:
type: string
byte-order:
enum: [ little-endian, big-endian ]
multi-attr:
type: boolean
nested-attributes:
description: Name of the space (sub-space) used inside the attribute.
type: string
enum:
description: Name of the enum type used for the attribute.
type: string
enum-as-flags:
description: |
Treat the enum as flags. In most cases enum is either used as flags or as values.
Sometimes, however, both forms are necessary, in which case header contains the enum
form while specific attributes may request to convert the values into a bitfield.
type: boolean
checks:
description: Kernel input validation.
type: object
additionalProperties: False
properties:
flags-mask:
description: Name of the flags constant on which to base mask (unsigned scalar types only).
type: string
min:
description: Min value for an integer attribute.
$ref: '#/$defs/len-or-limit'
max:
description: Max value for an integer attribute.
$ref: '#/$defs/len-or-limit'
min-len:
description: Min length for a binary attribute.
$ref: '#/$defs/len-or-define'
max-len:
description: Max length for a string or a binary attribute.
$ref: '#/$defs/len-or-define'
exact-len:
description: Exact length for a string or a binary attribute.
$ref: '#/$defs/len-or-define'
unterminated-ok:
description: |
For string attributes, do not check whether attribute
contains the terminating null character.
type: boolean
sub-type: *attr-type
display-hint: *display-hint
# Start genetlink-c
name-prefix:
type: string
# End genetlink-c
# Start genetlink-legacy
struct:
description: Name of the struct type used for the attribute.
type: string
# End genetlink-legacy
# Start netlink-raw
sub-message:
description: |
Name of the sub-message definition to use for the attribute.
type: string
selector:
description: |
Name of the attribute to use for dynamic selection of sub-message
format specifier.
type: string
# End netlink-raw
# Make sure name-prefix does not appear in subsets (subsets inherit naming)
dependencies:
name-prefix:
not:
required: [ subset-of ]
subset-of:
not:
required: [ name-prefix ]
# type property is only required if not in subset definition
if:
properties:
subset-of:
not:
type: string
then:
properties:
attributes:
items:
required: [ type ]
# Start netlink-raw
sub-messages:
description: Definition of sub message attributes
type: array
items:
type: object
additionalProperties: False
required: [ name, formats ]
properties:
name:
description: Name of the sub-message definition
type: string
formats:
description: Dynamically selected format specifiers
type: array
items:
type: object
additionalProperties: False
required: [ value ]
properties:
value:
description: |
Value to match for dynamic selection of sub-message format
specifier.
type: string
fixed-header:
description: |
Name of the struct definition to use as the fixed header
for the sub message.
type: string
attribute-set:
description: |
Name of the attribute space from which to resolve attributes
in the sub message.
type: string
# End netlink-raw
operations:
description: Operations supported by the protocol.
type: object
required: [ list ]
additionalProperties: False
properties:
enum-model:
description: |
The model of assigning values to the operations.
"unified" is the recommended model where all message types belong
to a single enum.
"directional" has the messages sent to the kernel and from the kernel
enumerated separately.
enum: [ unified, directional ] # Trim
name-prefix:
description: |
Prefix for the C enum name of the command. The name is formed by concatenating
the prefix with the upper case name of the command, with dashes replaced by underscores.
type: string
enum-name:
description: |
Name for the enum type with commands, if empty no name will be used.
type: [ string, "null" ]
async-prefix:
description: Same as name-prefix but used to render notifications and events to separate enum.
type: string
async-enum:
description: |
Name for the enum type with commands, if empty no name will be used.
type: [ string, "null" ]
# Start genetlink-legacy
fixed-header: &fixed-header
description: |
Name of the structure defining the optional fixed-length protocol
header. This header is placed in a message after the netlink and
genetlink headers and before any attributes.
type: string
# End genetlink-legacy
list:
description: List of commands
type: array
items:
type: object
additionalProperties: False
required: [ name, doc ]
properties:
name:
description: Name of the operation, also defining its C enum value in uAPI.
$ref: '#/$defs/name'
doc:
description: Documentation for the command.
type: string
value:
description: Value for the enum in the uAPI.
$ref: '#/$defs/uint'
attribute-set:
description: |
Attribute space from which attributes directly in the requests and replies
to this command are defined.
type: string
flags: &cmd_flags
description: Command flags.
type: array
items:
enum: [ admin-perm ]
dont-validate:
description: Kernel attribute validation flags.
type: array
items:
enum: [ strict, dump ]
# Start genetlink-legacy
fixed-header: *fixed-header
# End genetlink-legacy
do: &subop-type
description: Main command handler.
type: object
additionalProperties: False
properties:
request: &subop-attr-list
description: Definition of the request message for a given command.
type: object
additionalProperties: False
properties:
attributes:
description: |
Names of attributes from the attribute-set (not full attribute
definitions, just names).
type: array
items:
type: string
# Start genetlink-legacy
value:
description: |
ID of this message if value for request and response differ,
i.e. requests and responses have different message enums.
$ref: '#/$defs/uint'
# End genetlink-legacy
reply: *subop-attr-list
pre:
description: Hook for a function to run before the main callback (pre_doit or start).
type: string
post:
description: Hook for a function to run after the main callback (post_doit or done).
type: string
dump: *subop-type
notify:
description: Name of the command sharing the reply type with this notification.
type: string
event:
type: object
additionalProperties: False
properties:
attributes:
description: Explicit list of the attributes for the notification.
type: array
items:
type: string
mcgrp:
description: Name of the multicast group generating given notification.
type: string
mcast-groups:
description: List of multicast groups.
type: object
required: [ list ]
additionalProperties: False
properties:
list:
description: List of groups.
type: array
items:
type: object
required: [ name ]
additionalProperties: False
properties:
name:
description: |
The name for the group, used to form the define and the value of the define.
type: string
# Start genetlink-c
c-define-name:
description: Override for the name of the define in C uAPI.
type: string
# End genetlink-c
flags: *cmd_flags
# Start netlink-raw
value:
description: Value of the netlink multicast group in the uAPI.
type: integer
# End netlink-raw
@@ -0,0 +1,93 @@
# SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)
#
# Copyright 2025 Google LLC
#
---
name: binder
protocol: genetlink
uapi-header: linux/android/binder_netlink.h
doc: Binder interface over generic netlink
attribute-sets:
-
name: report
doc: |
Attributes included within a transaction failure report. The elements
correspond directly with the specific transaction that failed, along
with the error returned to the sender e.g. BR_DEAD_REPLY.
attributes:
-
name: error
type: u32
doc: The enum binder_driver_return_protocol returned to the sender.
-
name: context
type: string
doc: The binder context where the transaction occurred.
-
name: from-pid
type: u32
doc: The PID of the sender process.
-
name: from-tid
type: u32
doc: The TID of the sender thread.
-
name: to-pid
type: u32
doc: |
The PID of the recipient process. This attribute may not be present
if the target could not be determined.
-
name: to-tid
type: u32
doc: |
The TID of the recipient thread. This attribute may not be present
if the target could not be determined.
-
name: is-reply
type: flag
doc: When present, indicates the failed transaction is a reply.
-
name: flags
type: u32
doc: The bitmask of enum transaction_flags from the transaction.
-
name: code
type: u32
doc: The application-defined code from the transaction.
-
name: data-size
type: u32
doc: The transaction payload size in bytes.
operations:
list:
-
name: report
doc: |
A multicast event sent to userspace subscribers to notify them about
binder transaction failures. The generated report provides the full
details of the specific transaction that failed. The intention is for
programs to monitor these events and react to the failures as needed.
attribute-set: report
mcgrp: report
event:
attributes:
- error
- context
- from-pid
- from-tid
- to-pid
- to-tid
- is-reply
- flags
- code
- data-size
mcast-groups:
list:
-
name: report
@@ -0,0 +1,642 @@
# SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)
---
name: conntrack
protocol: netlink-raw
protonum: 12
doc: >-
Netfilter connection tracking subsystem over nfnetlink
definitions:
-
name: nfgenmsg
type: struct
members:
-
name: nfgen-family
type: u8
-
name: version
type: u8
-
name: res-id
byte-order: big-endian
type: u16
-
name: nf-ct-tcp-flags-mask
type: struct
members:
-
name: flags
type: u8
enum: nf-ct-tcp-flags
enum-as-flags: true
-
name: mask
type: u8
enum: nf-ct-tcp-flags
enum-as-flags: true
-
name: nf-ct-tcp-flags
type: flags
entries:
- window-scale
- sack-perm
- close-init
- be-liberal
- unacked
- maxack
- challenge-ack
- simultaneous-open
-
name: nf-ct-tcp-state
type: enum
entries:
- none
- syn-sent
- syn-recv
- established
- fin-wait
- close-wait
- last-ack
- time-wait
- close
- syn-sent2
- max
- ignore
- retrans
- unack
- timeout-max
-
name: nf-ct-sctp-state
type: enum
entries:
- none
- cloned
- cookie-wait
- cookie-echoed
- established
- shutdown-sent
- shutdown-received
- shutdown-ack-sent
- shutdown-heartbeat-sent
-
name: nf-ct-status
type: flags
entries:
- expected
- seen-reply
- assured
- confirmed
- src-nat
- dst-nat
- seq-adj
- src-nat-done
- dst-nat-done
- dying
- fixed-timeout
- template
- nat-clash
- helper
- offload
- hw-offload
attribute-sets:
-
name: counter-attrs
attributes:
-
name: packets
type: u64
byte-order: big-endian
-
name: bytes
type: u64
byte-order: big-endian
-
name: packets-old
type: u32
-
name: bytes-old
type: u32
-
name: pad
type: pad
-
name: tuple-proto-attrs
attributes:
-
name: proto-num
type: u8
doc: l4 protocol number
-
name: proto-src-port
type: u16
byte-order: big-endian
doc: l4 source port
-
name: proto-dst-port
type: u16
byte-order: big-endian
doc: l4 source port
-
name: proto-icmp-id
type: u16
byte-order: big-endian
doc: l4 icmp id
-
name: proto-icmp-type
type: u8
-
name: proto-icmp-code
type: u8
-
name: proto-icmpv6-id
type: u16
byte-order: big-endian
doc: l4 icmp id
-
name: proto-icmpv6-type
type: u8
-
name: proto-icmpv6-code
type: u8
-
name: tuple-ip-attrs
attributes:
-
name: ip-v4-src
type: u32
byte-order: big-endian
display-hint: ipv4
doc: ipv4 source address
-
name: ip-v4-dst
type: u32
byte-order: big-endian
display-hint: ipv4
doc: ipv4 destination address
-
name: ip-v6-src
type: binary
checks:
min-len: 16
byte-order: big-endian
display-hint: ipv6
doc: ipv6 source address
-
name: ip-v6-dst
type: binary
checks:
min-len: 16
byte-order: big-endian
display-hint: ipv6
doc: ipv6 destination address
-
name: tuple-attrs
attributes:
-
name: tuple-ip
type: nest
nested-attributes: tuple-ip-attrs
doc: conntrack l3 information
-
name: tuple-proto
type: nest
nested-attributes: tuple-proto-attrs
doc: conntrack l4 information
-
name: tuple-zone
type: u16
byte-order: big-endian
doc: conntrack zone id
-
name: protoinfo-tcp-attrs
attributes:
-
name: tcp-state
type: u8
enum: nf-ct-tcp-state
doc: tcp connection state
-
name: tcp-wscale-original
type: u8
doc: window scaling factor in original direction
-
name: tcp-wscale-reply
type: u8
doc: window scaling factor in reply direction
-
name: tcp-flags-original
type: binary
struct: nf-ct-tcp-flags-mask
-
name: tcp-flags-reply
type: binary
struct: nf-ct-tcp-flags-mask
-
name: protoinfo-dccp-attrs
attributes:
-
name: dccp-state
type: u8
doc: dccp connection state
-
name: dccp-role
type: u8
-
name: dccp-handshake-seq
type: u64
byte-order: big-endian
-
name: dccp-pad
type: pad
-
name: protoinfo-sctp-attrs
attributes:
-
name: sctp-state
type: u8
doc: sctp connection state
enum: nf-ct-sctp-state
-
name: vtag-original
type: u32
byte-order: big-endian
-
name: vtag-reply
type: u32
byte-order: big-endian
-
name: protoinfo-attrs
attributes:
-
name: protoinfo-tcp
type: nest
nested-attributes: protoinfo-tcp-attrs
doc: conntrack tcp state information
-
name: protoinfo-dccp
type: nest
nested-attributes: protoinfo-dccp-attrs
doc: conntrack dccp state information
-
name: protoinfo-sctp
type: nest
nested-attributes: protoinfo-sctp-attrs
doc: conntrack sctp state information
-
name: help-attrs
attributes:
-
name: help-name
type: string
doc: helper name
-
name: nat-proto-attrs
attributes:
-
name: nat-port-min
type: u16
byte-order: big-endian
-
name: nat-port-max
type: u16
byte-order: big-endian
-
name: nat-attrs
attributes:
-
name: nat-v4-minip
type: u32
byte-order: big-endian
-
name: nat-v4-maxip
type: u32
byte-order: big-endian
-
name: nat-v6-minip
type: binary
-
name: nat-v6-maxip
type: binary
-
name: nat-proto
type: nest
nested-attributes: nat-proto-attrs
-
name: seqadj-attrs
attributes:
-
name: correction-pos
type: u32
byte-order: big-endian
-
name: offset-before
type: u32
byte-order: big-endian
-
name: offset-after
type: u32
byte-order: big-endian
-
name: secctx-attrs
attributes:
-
name: secctx-name
type: string
-
name: synproxy-attrs
attributes:
-
name: isn
type: u32
byte-order: big-endian
-
name: its
type: u32
byte-order: big-endian
-
name: tsoff
type: u32
byte-order: big-endian
-
name: conntrack-attrs
attributes:
-
name: tuple-orig
type: nest
nested-attributes: tuple-attrs
doc: conntrack l3+l4 protocol information, original direction
-
name: tuple-reply
type: nest
nested-attributes: tuple-attrs
doc: conntrack l3+l4 protocol information, reply direction
-
name: status
type: u32
byte-order: big-endian
enum: nf-ct-status
enum-as-flags: true
doc: conntrack flag bits
-
name: protoinfo
type: nest
nested-attributes: protoinfo-attrs
-
name: help
type: nest
nested-attributes: help-attrs
-
name: nat-src
type: nest
nested-attributes: nat-attrs
-
name: timeout
type: u32
byte-order: big-endian
-
name: mark
type: u32
byte-order: big-endian
-
name: counters-orig
type: nest
nested-attributes: counter-attrs
-
name: counters-reply
type: nest
nested-attributes: counter-attrs
-
name: use
type: u32
byte-order: big-endian
-
name: id
type: u32
byte-order: big-endian
-
name: nat-dst
type: nest
nested-attributes: nat-attrs
-
name: tuple-master
type: nest
nested-attributes: tuple-attrs
-
name: seq-adj-orig
type: nest
nested-attributes: seqadj-attrs
-
name: seq-adj-reply
type: nest
nested-attributes: seqadj-attrs
-
name: secmark
type: binary
doc: obsolete
-
name: zone
type: u16
byte-order: big-endian
doc: conntrack zone id
-
name: secctx
type: nest
nested-attributes: secctx-attrs
-
name: timestamp
type: u64
byte-order: big-endian
-
name: mark-mask
type: u32
byte-order: big-endian
-
name: labels
type: binary
-
name: labels-mask
type: binary
-
name: synproxy
type: nest
nested-attributes: synproxy-attrs
-
name: filter
type: nest
nested-attributes: tuple-attrs
-
name: status-mask
type: u32
byte-order: big-endian
enum: nf-ct-status
enum-as-flags: true
doc: conntrack flag bits to change
-
name: timestamp-event
type: u64
byte-order: big-endian
-
name: conntrack-stats-attrs
attributes:
-
name: searched
type: u32
byte-order: big-endian
doc: obsolete
-
name: found
type: u32
byte-order: big-endian
-
name: new
type: u32
byte-order: big-endian
doc: obsolete
-
name: invalid
type: u32
byte-order: big-endian
doc: obsolete
-
name: ignore
type: u32
byte-order: big-endian
doc: obsolete
-
name: delete
type: u32
byte-order: big-endian
doc: obsolete
-
name: delete-list
type: u32
byte-order: big-endian
doc: obsolete
-
name: insert
type: u32
byte-order: big-endian
-
name: insert-failed
type: u32
byte-order: big-endian
-
name: drop
type: u32
byte-order: big-endian
-
name: early-drop
type: u32
byte-order: big-endian
-
name: error
type: u32
byte-order: big-endian
-
name: search-restart
type: u32
byte-order: big-endian
-
name: clash-resolve
type: u32
byte-order: big-endian
-
name: chain-toolong
type: u32
byte-order: big-endian
operations:
enum-model: directional
list:
-
name: get
doc: get / dump entries
attribute-set: conntrack-attrs
fixed-header: nfgenmsg
do:
request:
value: 0x101
attributes:
- tuple-orig
- tuple-reply
- zone
reply:
value: 0x100
attributes:
- tuple-orig
- tuple-reply
- status
- protoinfo
- help
- nat-src
- nat-dst
- timeout
- mark
- counters-orig
- counters-reply
- use
- id
- nat-dst
- tuple-master
- seq-adj-orig
- seq-adj-reply
- zone
- secctx
- labels
- synproxy
dump:
request:
value: 0x101
attributes:
- mark
- filter
- status
- zone
reply:
value: 0x100
attributes:
- tuple-orig
- tuple-reply
- status
- protoinfo
- help
- nat-src
- nat-dst
- timeout
- mark
- counters-orig
- counters-reply
- use
- id
- nat-dst
- tuple-master
- seq-adj-orig
- seq-adj-reply
- zone
- secctx
- labels
- synproxy
-
name: get-stats
doc: dump pcpu conntrack stats
attribute-set: conntrack-stats-attrs
fixed-header: nfgenmsg
dump:
request:
value: 0x104
reply:
value: 0x104
attributes:
- searched
- found
- insert
- insert-failed
- drop
- early-drop
- error
- search-restart
- clash-resolve
- chain-toolong
@@ -0,0 +1,175 @@
# SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)
#
# Copyright (c) 2025 Valve Corporation.
#
---
name: dev-energymodel
doc: |
Energy model netlink interface to notify its changes.
protocol: genetlink
uapi-header: linux/dev_energymodel.h
definitions:
-
type: flags
name: perf-state-flags
entries:
-
name: perf-state-inefficient
doc: >-
The performance state is inefficient. There is in this perf-domain,
another performance state with a higher frequency but a lower or
equal power cost.
-
type: flags
name: perf-domain-flags
entries:
-
name: perf-domain-microwatts
doc: >-
The power values are in micro-Watts or some other scale.
-
name: perf-domain-skip-inefficiencies
doc: >-
Skip inefficient states when estimating energy consumption.
-
name: perf-domain-artificial
doc: >-
The power values are artificial and might be created by platform
missing real power information.
attribute-sets:
-
name: perf-domain
doc: >-
Information on a single performance domains.
attributes:
-
name: pad
type: pad
-
name: perf-domain-id
type: u32
doc: >-
A unique ID number for each performance domain.
-
name: flags
type: u64
doc: >-
Bitmask of performance domain flags.
enum: perf-domain-flags
-
name: cpus
type: u64
multi-attr: true
doc: >-
CPUs that belong to this performance domain.
-
name: perf-table
doc: >-
Performance states table.
attributes:
-
name: perf-domain-id
type: u32
doc: >-
A unique ID number for each performance domain.
-
name: perf-state
type: nest
nested-attributes: perf-state
multi-attr: true
-
name: perf-state
doc: >-
Performance state of a performance domain.
attributes:
-
name: pad
type: pad
-
name: performance
type: u64
doc: >-
CPU performance (capacity) at a given frequency.
-
name: frequency
type: u64
doc: >-
The frequency in KHz, for consistency with CPUFreq.
-
name: power
type: u64
doc: >-
The power consumed at this level (by 1 CPU or by a registered
device). It can be a total power: static and dynamic.
-
name: cost
type: u64
doc: >-
The cost coefficient associated with this level, used during energy
calculation. Equal to: power * max_frequency / frequency.
-
name: flags
type: u64
doc: >-
Bitmask of performance state flags.
enum: perf-state-flags
operations:
list:
-
name: get-perf-domains
attribute-set: perf-domain
doc: Get the list of information for all performance domains.
do:
request:
attributes:
- perf-domain-id
reply:
attributes: &perf-domain-attrs
- pad
- perf-domain-id
- flags
- cpus
dump:
reply:
attributes: *perf-domain-attrs
-
name: get-perf-table
attribute-set: perf-table
doc: Get the energy model table of a performance domain.
do:
request:
attributes:
- perf-domain-id
reply:
attributes:
- perf-domain-id
- perf-state
-
name: perf-domain-created
doc: A performance domain is created.
notify: get-perf-table
mcgrp: event
-
name: perf-domain-updated
doc: A performance domain is updated.
notify: get-perf-table
mcgrp: event
-
name: perf-domain-deleted
doc: A performance domain is deleted.
attribute-set: perf-table
event:
attributes:
- perf-domain-id
mcgrp: event
mcast-groups:
list:
-
name: event
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,770 @@
# SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)
---
name: dpll
doc: DPLL subsystem.
definitions:
-
type: enum
name: mode
doc: |
working modes a dpll can support, differentiates if and how dpll selects
one of its inputs to syntonize with it, valid values for DPLL_A_MODE
attribute
entries:
-
name: manual
doc: input can be only selected by sending a request to dpll
value: 1
-
name: automatic
doc: highest prio input pin auto selected by dpll
render-max: true
-
type: enum
name: lock-status
doc: |
provides information of dpll device lock status, valid values for
DPLL_A_LOCK_STATUS attribute
entries:
-
name: unlocked
doc: |
dpll was not yet locked to any valid input (or forced by setting
DPLL_A_MODE to DPLL_MODE_DETACHED)
value: 1
-
name: locked
doc: |
dpll is locked to a valid signal, but no holdover available
-
name: locked-ho-acq
doc: |
dpll is locked and holdover acquired
-
name: holdover
doc: |
dpll is in holdover state - lost a valid lock or was forced
by disconnecting all the pins (latter possible only
when dpll lock-state was already DPLL_LOCK_STATUS_LOCKED_HO_ACQ,
if dpll lock-state was not DPLL_LOCK_STATUS_LOCKED_HO_ACQ, the
dpll's lock-state shall remain DPLL_LOCK_STATUS_UNLOCKED)
render-max: true
-
type: enum
name: lock-status-error
doc: |
if previous status change was done due to a failure, this provides
information of dpll device lock status error.
Valid values for DPLL_A_LOCK_STATUS_ERROR attribute
entries:
-
name: none
doc: |
dpll device lock status was changed without any error
value: 1
-
name: undefined
doc: |
dpll device lock status was changed due to undefined error.
Driver fills this value up in case it is not able
to obtain suitable exact error type.
-
name: media-down
doc: |
dpll device lock status was changed because of associated
media got down.
This may happen for example if dpll device was previously
locked on an input pin of type PIN_TYPE_SYNCE_ETH_PORT.
-
name: fractional-frequency-offset-too-high
doc: |
the FFO (Fractional Frequency Offset) between the RX and TX
symbol rate on the media got too high.
This may happen for example if dpll device was previously
locked on an input pin of type PIN_TYPE_SYNCE_ETH_PORT.
render-max: true
-
type: enum
name: clock-quality-level
doc: |
level of quality of a clock device. This mainly applies when
the dpll lock-status is DPLL_LOCK_STATUS_HOLDOVER.
The current list is defined according to the table 11-7 contained
in ITU-T G.8264/Y.1364 document. One may extend this list freely
by other ITU-T defined clock qualities, or different ones defined
by another standardization body (for those, please use
different prefix).
entries:
-
name: itu-opt1-prc
value: 1
-
name: itu-opt1-ssu-a
-
name: itu-opt1-ssu-b
-
name: itu-opt1-eec1
-
name: itu-opt1-prtc
-
name: itu-opt1-eprtc
-
name: itu-opt1-eeec
-
name: itu-opt1-eprc
render-max: true
-
type: const
name: temp-divider
value: 1000
doc: |
temperature divider allowing userspace to calculate the
temperature as float with three digit decimal precision.
Value of (DPLL_A_TEMP / DPLL_TEMP_DIVIDER) is integer part of
temperature value.
Value of (DPLL_A_TEMP % DPLL_TEMP_DIVIDER) is fractional part of
temperature value.
-
type: enum
name: type
doc: type of dpll, valid values for DPLL_A_TYPE attribute
entries:
-
name: pps
doc: dpll produces Pulse-Per-Second signal
value: 1
-
name: eec
doc: dpll drives the Ethernet Equipment Clock
-
name: generic
doc: generic dpll type for devices outside PPS/EEC classes
render-max: true
-
type: enum
name: pin-type
doc: |
defines possible types of a pin, valid values for DPLL_A_PIN_TYPE
attribute
entries:
-
name: mux
doc: aggregates another layer of selectable pins
value: 1
-
name: ext
doc: external input
-
name: synce-eth-port
doc: ethernet port PHY's recovered clock
-
name: int-oscillator
doc: device internal oscillator
-
name: gnss
doc: GNSS recovered clock
render-max: true
-
type: enum
name: pin-direction
doc: |
defines possible direction of a pin, valid values for
DPLL_A_PIN_DIRECTION attribute
entries:
-
name: input
doc: pin used as a input of a signal
value: 1
-
name: output
doc: pin used to output the signal
render-max: true
-
type: const
name: pin-frequency-1-hz
value: 1
-
type: const
name: pin-frequency-10-khz
value: 10000
-
type: const
name: pin-frequency-77-5-khz
value: 77500
-
type: const
name: pin-frequency-10-mhz
value: 10000000
-
type: enum
name: pin-state
doc: |
defines possible states of a pin, valid values for
DPLL_A_PIN_STATE attribute
entries:
-
name: connected
doc: pin connected, active input of phase locked loop
value: 1
-
name: disconnected
doc: pin disconnected, not considered as a valid input
-
name: selectable
doc: pin enabled for automatic input selection
render-max: true
-
type: enum
name: pin-operstate
doc: |
defines possible operational states of a pin with respect to its
parent DPLL device, valid values for DPLL_A_PIN_OPERSTATE attribute
entries:
-
name: active
doc: pin is qualified and actively used by the DPLL
value: 1
-
name: standby
doc: pin is qualified but not actively used by the DPLL
-
name: no-signal
doc: pin does not have a valid signal
-
name: qual-failed
doc: pin signal failed qualification (e.g. frequency or phase monitor)
render-max: true
-
type: flags
name: pin-capabilities
doc: |
defines possible capabilities of a pin, valid flags on
DPLL_A_PIN_CAPABILITIES attribute
entries:
-
name: direction-can-change
doc: pin direction can be changed
-
name: priority-can-change
doc: pin priority can be changed
-
name: state-can-change
doc: pin state can be changed
-
type: const
name: phase-offset-divider
value: 1000
doc: |
phase offset divider allows userspace to calculate a value of
measured signal phase difference between a pin and dpll device
as a fractional value with three digit decimal precision.
Value of (DPLL_A_PHASE_OFFSET / DPLL_PHASE_OFFSET_DIVIDER) is an
integer part of a measured phase offset value.
Value of (DPLL_A_PHASE_OFFSET % DPLL_PHASE_OFFSET_DIVIDER) is a
fractional part of a measured phase offset value.
-
type: const
name: pin-measured-frequency-divider
value: 1000
doc: |
pin measured frequency divider allows userspace to calculate
a value of measured input frequency as a fractional value with
three digit decimal precision (millihertz).
Value of (DPLL_A_PIN_MEASURED_FREQUENCY /
DPLL_PIN_MEASURED_FREQUENCY_DIVIDER) is an integer part of
a measured frequency value.
Value of (DPLL_A_PIN_MEASURED_FREQUENCY %
DPLL_PIN_MEASURED_FREQUENCY_DIVIDER) is a fractional part of
a measured frequency value.
-
type: enum
name: feature-state
doc: |
Allow control (enable/disable) and status checking over features.
entries:
-
name: disable
doc: |
feature shall be disabled
-
name: enable
doc: |
feature shall be enabled
attribute-sets:
-
name: dpll
enum-name: dpll_a
attributes:
-
name: id
type: u32
-
name: module-name
type: string
-
name: pad
type: pad
-
name: clock-id
type: u64
-
name: mode
type: u32
enum: mode
-
name: mode-supported
type: u32
enum: mode
multi-attr: true
-
name: lock-status
type: u32
enum: lock-status
-
name: temp
type: s32
-
name: type
type: u32
enum: type
-
name: lock-status-error
type: u32
enum: lock-status-error
-
name: clock-quality-level
type: u32
enum: clock-quality-level
multi-attr: true
doc: |
Level of quality of a clock device. This mainly applies when
the dpll lock-status is DPLL_LOCK_STATUS_HOLDOVER. This could
be put to message multiple times to indicate possible parallel
quality levels (e.g. one specified by ITU option 1 and another
one specified by option 2).
-
name: phase-offset-monitor
type: u32
enum: feature-state
doc: Receive or request state of phase offset monitor feature.
If enabled, dpll device shall monitor and notify all currently
available inputs for changes of their phase offset against the
dpll device.
-
name: phase-offset-avg-factor
type: u32
doc: Averaging factor applied to calculation of reported phase offset.
-
name: frequency-monitor
type: u32
enum: feature-state
doc: Current or desired state of the frequency monitor feature.
If enabled, dpll device shall measure all currently available
inputs for their actual input frequency.
-
name: pin
enum-name: dpll_a_pin
attributes:
-
name: id
type: u32
-
name: parent-id
type: u32
-
name: module-name
type: string
-
name: pad
type: pad
-
name: clock-id
type: u64
-
name: board-label
type: string
-
name: panel-label
type: string
-
name: package-label
type: string
-
name: type
type: u32
enum: pin-type
-
name: direction
type: u32
enum: pin-direction
-
name: frequency
type: u64
-
name: frequency-supported
type: nest
multi-attr: true
nested-attributes: frequency-range
-
name: frequency-min
type: u64
-
name: frequency-max
type: u64
-
name: prio
type: u32
-
name: state
type: u32
enum: pin-state
-
name: capabilities
type: u32
enum: pin-capabilities
-
name: parent-device
type: nest
multi-attr: true
nested-attributes: pin-parent-device
-
name: parent-pin
type: nest
multi-attr: true
nested-attributes: pin-parent-pin
-
name: phase-adjust-min
type: s32
-
name: phase-adjust-max
type: s32
-
name: phase-adjust
type: s32
-
name: phase-offset
type: s64
-
name: fractional-frequency-offset
type: sint
doc: |
The FFO (Fractional Frequency Offset) of the pin.
At top level this represents the RX vs TX symbol rate
offset on the media associated with the pin. Inside
the pin-parent-device nest it represents the frequency
offset between the pin and its parent DPLL device.
Value is in PPM (parts per million).
This is a lower-precision version of
fractional-frequency-offset-ppt.
-
name: esync-frequency
type: u64
doc: |
Frequency of Embedded SYNC signal. If provided, the pin is configured
with a SYNC signal embedded into its base clock frequency.
-
name: esync-frequency-supported
type: nest
multi-attr: true
nested-attributes: frequency-range
doc: |
If provided a pin is capable of embedding a SYNC signal (within given
range) into its base frequency signal.
-
name: esync-pulse
type: u32
doc: |
A ratio of high to low state of a SYNC signal pulse embedded
into base clock frequency. Value is in percents.
-
name: reference-sync
type: nest
multi-attr: true
nested-attributes: reference-sync
doc: |
Capable pin provides list of pins that can be bound to create a
reference-sync pin pair.
-
name: phase-adjust-gran
type: u32
doc: |
Granularity of phase adjustment, in picoseconds. The value of
phase adjustment must be a multiple of this granularity.
-
name: fractional-frequency-offset-ppt
type: sint
doc: |
The FFO (Fractional Frequency Offset) of the pin.
At top level this represents the RX vs TX symbol rate
offset on the media associated with the pin. Inside
the pin-parent-device nest it represents the frequency
offset between the pin and its parent DPLL device.
Value is in PPT (parts per trillion, 10^-12).
This is a higher-precision version of
fractional-frequency-offset.
-
name: measured-frequency
type: u64
doc: |
The measured frequency of the input pin in millihertz (mHz).
Value of (DPLL_A_PIN_MEASURED_FREQUENCY /
DPLL_PIN_MEASURED_FREQUENCY_DIVIDER) is an integer part (Hz)
of a measured frequency value.
Value of (DPLL_A_PIN_MEASURED_FREQUENCY %
DPLL_PIN_MEASURED_FREQUENCY_DIVIDER) is a fractional part
of a measured frequency value.
-
name: operstate
type: u32
enum: pin-operstate
doc: |
Operational state of the pin with respect to its parent DPLL
device. Unlike state (which reflects the administrative intent),
operstate reflects the actual hardware status.
-
name: pin-parent-device
subset-of: pin
attributes:
-
name: parent-id
-
name: direction
-
name: prio
-
name: state
-
name: operstate
-
name: phase-offset
-
name: fractional-frequency-offset
-
name: fractional-frequency-offset-ppt
-
name: pin-parent-pin
subset-of: pin
attributes:
-
name: parent-id
-
name: state
-
name: frequency-range
subset-of: pin
attributes:
-
name: frequency-min
-
name: frequency-max
-
name: reference-sync
subset-of: pin
attributes:
-
name: id
-
name: state
operations:
enum-name: dpll_cmd
list:
-
name: device-id-get
doc: |
Get id of dpll device that matches given attributes
attribute-set: dpll
flags: [admin-perm]
do:
pre: dpll-lock-doit
post: dpll-unlock-doit
request:
attributes:
- module-name
- clock-id
- type
reply:
attributes:
- id
-
name: device-get
doc: |
Get list of DPLL devices (dump) or attributes of a single dpll device
attribute-set: dpll
flags: [admin-perm]
do:
pre: dpll-pre-doit
post: dpll-post-doit
request:
attributes:
- id
reply: &dev-attrs
attributes:
- id
- module-name
- mode
- mode-supported
- lock-status
- lock-status-error
- temp
- clock-id
- type
- phase-offset-monitor
- phase-offset-avg-factor
- frequency-monitor
dump:
reply: *dev-attrs
-
name: device-set
doc: Set attributes for a DPLL device
attribute-set: dpll
flags: [admin-perm]
do:
pre: dpll-pre-doit
post: dpll-post-doit
request:
attributes:
- id
- mode
- phase-offset-monitor
- phase-offset-avg-factor
- frequency-monitor
-
name: device-create-ntf
doc: Notification about device appearing
notify: device-get
mcgrp: monitor
-
name: device-delete-ntf
doc: Notification about device disappearing
notify: device-get
mcgrp: monitor
-
name: device-change-ntf
doc: Notification about device configuration being changed
notify: device-get
mcgrp: monitor
-
name: pin-id-get
doc: |
Get id of a pin that matches given attributes
attribute-set: pin
flags: [admin-perm]
do:
pre: dpll-lock-doit
post: dpll-unlock-doit
request:
attributes:
- module-name
- clock-id
- board-label
- panel-label
- package-label
- type
reply:
attributes:
- id
-
name: pin-get
doc: |
Get list of pins and its attributes.
- dump request without any attributes given - list all the pins in the
system
- dump request with target dpll - list all the pins registered with
a given dpll device
- do request with target dpll and target pin - single pin attributes
attribute-set: pin
flags: [admin-perm]
do:
pre: dpll-pin-pre-doit
post: dpll-pin-post-doit
request:
attributes:
- id
reply: &pin-attrs
attributes:
- id
- module-name
- clock-id
- board-label
- panel-label
- package-label
- type
- frequency
- frequency-supported
- capabilities
- parent-device
- parent-pin
- phase-adjust-gran
- phase-adjust-min
- phase-adjust-max
- phase-adjust
- fractional-frequency-offset
- fractional-frequency-offset-ppt
- esync-frequency
- esync-frequency-supported
- esync-pulse
- reference-sync
- measured-frequency
dump:
request:
attributes:
- id
reply: *pin-attrs
-
name: pin-set
doc: Set attributes of a target pin
attribute-set: pin
flags: [admin-perm]
do:
pre: dpll-pin-pre-doit
post: dpll-pin-post-doit
request:
attributes:
- id
- frequency
- direction
- prio
- state
- parent-device
- parent-pin
- phase-adjust
- esync-frequency
- reference-sync
-
name: pin-create-ntf
doc: Notification about pin appearing
notify: pin-get
mcgrp: monitor
-
name: pin-delete-ntf
doc: Notification about pin disappearing
notify: pin-get
mcgrp: monitor
-
name: pin-change-ntf
doc: Notification about pin configuration being changed
notify: pin-get
mcgrp: monitor
mcast-groups:
list:
-
name: monitor
@@ -0,0 +1,126 @@
# SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)
---
name: drm-ras
protocol: genetlink
uapi-header: drm/drm_ras.h
doc: >-
DRM RAS (Reliability, Availability, Serviceability) over Generic Netlink.
Provides a standardized mechanism for DRM drivers to register "nodes"
representing hardware/software components capable of reporting error counters.
Userspace tools can query the list of nodes or individual error counters
via the Generic Netlink interface.
definitions:
-
type: enum
name: node-type
value-start: 1
entries: [error-counter]
doc: >-
Type of the node. Currently, only error-counter nodes are
supported, which expose reliability counters for a hardware/software
component.
attribute-sets:
-
name: node-attrs
attributes:
-
name: node-id
type: u32
doc: >-
Unique identifier for the node.
Assigned dynamically by the DRM RAS core upon registration.
-
name: device-name
type: string
doc: >-
Device name chosen by the driver at registration.
Can be a PCI BDF, UUID, or module name if unique.
-
name: node-name
type: string
doc: >-
Node name chosen by the driver at registration.
Can be an IP block name, or any name that identifies the
RAS node inside the device.
-
name: node-type
type: u32
doc: Type of this node, identifying its function.
enum: node-type
-
name: error-counter-attrs
attributes:
-
name: node-id
type: u32
doc: Node ID targeted by this error counter operation.
-
name: error-id
type: u32
doc: Unique identifier for a specific error counter within an node.
-
name: error-name
type: string
doc: Name of the error.
-
name: error-value
type: u32
doc: Current value of the requested error counter.
operations:
list:
-
name: list-nodes
doc: >-
Retrieve the full list of currently registered DRM RAS nodes.
Each node includes its dynamically assigned ID, name, and type.
**Important:** User space must call this operation first to obtain
the node IDs. These IDs are required for all subsequent
operations on nodes, such as querying error counters.
attribute-set: node-attrs
flags: [admin-perm]
dump:
reply:
attributes:
- node-id
- device-name
- node-name
- node-type
-
name: get-error-counter
doc: >-
Retrieve error counter for a given node.
The response includes the id, the name, and even the current
value of each counter.
attribute-set: error-counter-attrs
flags: [admin-perm]
do:
request:
attributes: &id-attrs
- node-id
- error-id
reply:
attributes: &errorinfo
- error-id
- error-name
- error-value
dump:
request:
attributes:
- node-id
reply:
attributes: *errorinfo
-
name: clear-error-counter
doc: >-
Clear error counter for a given node.
The request includes the error-id and node-id of the
counter to be cleared.
attribute-set: error-counter-attrs
flags: [admin-perm]
do:
request:
attributes: *id-attrs
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,134 @@
# SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)
---
name: fou
protocol: genetlink-legacy
doc: |
Foo-over-UDP.
c-family-name: fou-genl-name
c-version-name: fou-genl-version
max-by-define: true
kernel-policy: global
definitions:
-
type: enum
name: encap-type
name-prefix: fou-encap-
enum-name:
entries: [unspec, direct, gue]
attribute-sets:
-
name: fou
name-prefix: fou-attr-
attributes:
-
name: unspec
type: unused
value: 0
-
name: port
type: u16
byte-order: big-endian
-
name: af
type: u8
-
name: ipproto
type: u8
checks:
min: 1
-
name: type
type: u8
-
name: remcsum-nopartial
type: flag
-
name: local-v4
type: u32
-
name: local-v6
type: binary
checks:
exact-len: 16
-
name: peer-v4
type: u32
-
name: peer-v6
type: binary
checks:
exact-len: 16
-
name: peer-port
type: u16
byte-order: big-endian
-
name: ifindex
type: s32
operations:
list:
-
name: unspec
doc: unused
value: 0
-
name: add
doc: Add port.
attribute-set: fou
dont-validate: [strict, dump]
flags: [admin-perm]
do:
request: &all_attrs
attributes:
- port
- ipproto
- type
- remcsum-nopartial
- local-v4
- peer-v4
- local-v6
- peer-v6
- peer-port
- ifindex
-
name: del
doc: Delete port.
attribute-set: fou
dont-validate: [strict, dump]
flags: [admin-perm]
do:
request: &select_attrs
attributes:
- af
- ifindex
- port
- peer-port
- local-v4
- peer-v4
- local-v6
- peer-v6
-
name: get
doc: Get tunnel info.
attribute-set: fou
dont-validate: [strict, dump]
do:
request: *select_attrs
reply: *all_attrs
dump:
reply: *all_attrs
@@ -0,0 +1,141 @@
# SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)
#
# Author: Chuck Lever <chuck.lever@oracle.com>
#
# Copyright (c) 2023, Oracle and/or its affiliates.
#
---
name: handshake
protocol: genetlink
doc: Netlink protocol to request a transport layer security handshake.
definitions:
-
type: const
name: max-errno
value: 4095
header: linux/err.h
scope: kernel
-
type: enum
name: handler-class
value-start: 0
entries: [none, tlshd, max]
-
type: enum
name: msg-type
value-start: 0
entries: [unspec, clienthello, serverhello]
-
type: enum
name: auth
value-start: 0
entries: [unspec, unauth, psk, x509]
attribute-sets:
-
name: x509
attributes:
-
name: cert
type: s32
-
name: privkey
type: s32
-
name: accept
attributes:
-
name: sockfd
type: s32
-
name: handler-class
type: u32
enum: handler-class
-
name: message-type
type: u32
enum: msg-type
-
name: timeout
type: u32
-
name: auth-mode
type: u32
enum: auth
-
name: peer-identity
type: u32
multi-attr: true
-
name: certificate
type: nest
nested-attributes: x509
multi-attr: true
-
name: peername
type: string
-
name: keyring
type: u32
-
name: done
attributes:
-
name: status
type: u32
checks:
max: max-errno
-
name: sockfd
type: s32
-
name: remote-auth
type: u32
multi-attr: true
operations:
list:
-
name: ready
doc: Notify handlers that a new handshake request is waiting
notify: accept
-
name: accept
doc: Handler retrieves next queued handshake request
attribute-set: accept
flags: [admin-perm]
do:
request:
attributes:
- handler-class
reply:
attributes:
- sockfd
- message-type
- timeout
- auth-mode
- peer-identity
- certificate
- peername
- keyring
-
name: done
doc: Handler reports handshake completion
attribute-set: done
flags: [admin-perm]
do:
request:
attributes:
- status
- sockfd
- remote-auth
mcast-groups:
list:
-
name: none
-
name: tlshd
@@ -0,0 +1,13 @@
.. SPDX-License-Identifier: GPL-2.0
.. _specs:
=============================
Netlink Family Specifications
=============================
.. toctree::
:maxdepth: 1
:glob:
*
@@ -0,0 +1,45 @@
# SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)
---
name: lockd
protocol: genetlink
uapi-header: linux/lockd_netlink.h
doc: lockd configuration over generic netlink
attribute-sets:
-
name: server
attributes:
-
name: gracetime
type: u32
-
name: tcp-port
type: u16
-
name: udp-port
type: u16
operations:
list:
-
name: server-set
doc: set the lockd server parameters
attribute-set: server
flags: [admin-perm]
do:
request:
attributes:
- gracetime
- tcp-port
- udp-port
-
name: server-get
doc: get the lockd server parameters
attribute-set: server
do:
reply:
attributes:
- gracetime
- tcp-port
- udp-port
@@ -0,0 +1,396 @@
# SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)
---
name: mptcp_pm
protocol: genetlink-legacy
doc: Multipath TCP.
c-family-name: mptcp-pm-name
c-version-name: mptcp-pm-ver
max-by-define: true
kernel-policy: per-op
cmd-cnt-name: --mptcp-pm-cmd-after-last
definitions:
-
type: enum
name: event-type
enum-name: mptcp-event-type
doc: Netlink MPTCP event types
name-prefix: mptcp-event-
entries:
-
name: unspec
doc: unused event
-
name: created
doc: >-
A new MPTCP connection has been created. It is the good time to
allocate memory and send ADD_ADDR if needed. Depending on the
traffic-patterns it can take a long time until the
MPTCP_EVENT_ESTABLISHED is sent.
Attributes: token, family, saddr4 | saddr6, daddr4 | daddr6, sport,
dport, [server-side], [flags].
-
name: established
doc: >-
A MPTCP connection is established (can start new subflows).
Attributes: token, family, saddr4 | saddr6, daddr4 | daddr6, sport,
dport, [server-side], [flags].
-
name: closed
doc: >-
A MPTCP connection has stopped.
Attribute: token.
-
name: announced
value: 6
doc: >-
A new address has been announced by the peer.
Attributes: token, rem_id, family, daddr4 | daddr6 [, dport].
-
name: removed
doc: >-
An address has been lost by the peer.
Attributes: token, rem_id.
-
name: sub-established
value: 10
doc: >-
A new subflow has been established. 'error' should not be set.
Attributes: token, family, loc_id, rem_id, saddr4 | saddr6, daddr4 |
daddr6, sport, dport, backup, if-idx [, error].
-
name: sub-closed
doc: >-
A subflow has been closed. An error (copy of sk_err) could be set if
an error has been detected for this subflow.
Attributes: token, family, loc_id, rem_id, saddr4 | saddr6, daddr4 |
daddr6, sport, dport, backup, if-idx [, error].
-
name: sub-priority
value: 13
doc: >-
The priority of a subflow has changed. 'error' should not be set.
Attributes: token, family, loc_id, rem_id, saddr4 | saddr6, daddr4 |
daddr6, sport, dport, backup, if-idx [, error].
-
name: listener-created
value: 15
doc: >-
A new PM listener is created.
Attributes: family, sport, saddr4 | saddr6.
-
name: listener-closed
doc: >-
A PM listener is closed.
Attributes: family, sport, saddr4 | saddr6.
attribute-sets:
-
name: address
name-prefix: mptcp-pm-addr-attr-
attributes:
-
name: unspec
type: unused
value: 0
-
name: family
type: u16
-
name: id
type: u8
-
name: addr4
type: u32
byte-order: big-endian
-
name: addr6
type: binary
checks:
exact-len: 16
-
name: port
type: u16
-
name: flags
type: u32
-
name: if-idx
type: s32
-
name: subflow-attribute
name-prefix: mptcp-subflow-attr-
attributes:
-
name: unspec
type: unused
value: 0
-
name: token-rem
type: u32
-
name: token-loc
type: u32
-
name: relwrite-seq
type: u32
-
name: map-seq
type: u64
-
name: map-sfseq
type: u32
-
name: ssn-offset
type: u32
-
name: map-datalen
type: u16
-
name: flags
type: u32
-
name: id-rem
type: u8
-
name: id-loc
type: u8
-
name: pad
type: pad
-
name: endpoint
name-prefix: mptcp-pm-endpoint-
attributes:
-
name: addr
type: nest
nested-attributes: address
-
name: attr
name-prefix: mptcp-pm-attr-
attr-cnt-name: --mptcp-attr-after-last
attributes:
-
name: unspec
type: unused
value: 0
-
name: addr
type: nest
nested-attributes: address
-
name: rcv-add-addrs
type: u32
-
name: subflows
type: u32
-
name: token
type: u32
-
name: loc-id
type: u8
-
name: addr-remote
type: nest
nested-attributes: address
-
name: event-attr
enum-name: mptcp-event-attr
name-prefix: mptcp-attr-
attributes:
-
name: unspec
type: unused
value: 0
-
name: token
type: u32
-
name: family
type: u16
-
name: loc-id
type: u8
-
name: rem-id
type: u8
-
name: saddr4
type: u32
byte-order: big-endian
-
name: saddr6
type: binary
checks:
min-len: 16
-
name: daddr4
type: u32
byte-order: big-endian
-
name: daddr6
type: binary
checks:
min-len: 16
-
name: sport
type: u16
byte-order: big-endian
-
name: dport
type: u16
byte-order: big-endian
-
name: backup
type: u8
-
name: error
type: u8
-
name: flags
type: u16
-
name: timeout
type: u32
-
name: if-idx
type: s32
-
name: reset-reason
type: u32
-
name: reset-flags
type: u32
-
name: server-side
type: u8
doc: "Deprecated: use 'flags'"
operations:
list:
-
name: unspec
doc: unused
value: 0
-
name: add-addr
doc: Add endpoint
attribute-set: endpoint
dont-validate: [strict]
flags: [uns-admin-perm]
do: &add-addr-attrs
request:
attributes:
- addr
-
name: del-addr
doc: Delete endpoint
attribute-set: endpoint
dont-validate: [strict]
flags: [uns-admin-perm]
do: *add-addr-attrs
-
name: get-addr
doc: Get endpoint information
attribute-set: attr
dont-validate: [strict]
do: &get-addr-attrs
request:
attributes:
- addr
- token
reply:
attributes:
- addr
dump:
reply:
attributes:
- addr
-
name: flush-addrs
doc: Flush addresses
attribute-set: endpoint
dont-validate: [strict]
flags: [uns-admin-perm]
do: *add-addr-attrs
-
name: set-limits
doc: Set protocol limits
attribute-set: attr
dont-validate: [strict]
flags: [uns-admin-perm]
do: &mptcp-limits
request:
attributes:
- rcv-add-addrs
- subflows
-
name: get-limits
doc: Get protocol limits
attribute-set: attr
dont-validate: [strict]
do: &mptcp-get-limits
request:
attributes:
- rcv-add-addrs
- subflows
reply:
attributes:
- rcv-add-addrs
- subflows
-
name: set-flags
doc: Change endpoint flags
attribute-set: attr
dont-validate: [strict]
flags: [uns-admin-perm]
do: &mptcp-set-flags
request:
attributes:
- addr
- token
- addr-remote
-
name: announce
doc: Announce new address
attribute-set: attr
dont-validate: [strict]
flags: [uns-admin-perm]
do: &announce-add
request:
attributes:
- addr
- token
-
name: remove
doc: Announce removal
attribute-set: attr
dont-validate: [strict]
flags: [uns-admin-perm]
do:
request:
attributes:
- token
- loc-id
-
name: subflow-create
doc: Create subflow
attribute-set: attr
dont-validate: [strict]
flags: [uns-admin-perm]
do: &sf-create
request:
attributes:
- addr
- token
- addr-remote
-
name: subflow-destroy
doc: Destroy subflow
attribute-set: attr
dont-validate: [strict]
flags: [uns-admin-perm]
do: *sf-create
@@ -0,0 +1,370 @@
# SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)
---
name: net-shaper
doc: |
Networking HW rate limiting configuration.
This API allows configuring HW shapers available on the network
devices at different levels (queues, network device) and allows
arbitrary manipulation of the scheduling tree of the involved
shapers.
Each @shaper is identified within the given device, by a @handle,
comprising both a @scope and an @id.
Depending on the @scope value, the shapers are attached to specific
HW objects (queues, devices) or, for @node scope, represent a
scheduling group, that can be placed in an arbitrary location of
the scheduling tree.
Shapers can be created with two different operations: the @set
operation, to create and update a single "attached" shaper, and
the @group operation, to create and update a scheduling
group. Only the @group operation can create @node scope shapers.
Existing shapers can be deleted/reset via the @delete operation.
The user can query the running configuration via the @get operation.
Different devices can provide different feature sets, e.g. with no
support for complex scheduling hierarchy, or for some shaping
parameters. The user can introspect the HW capabilities via the
@cap-get operation.
definitions:
-
type: const
name: max-handle-id
value: 0x3fffffe
scope: kernel
-
type: enum
name: scope
doc: Defines the shaper @id interpretation.
render-max: true
entries:
- name: unspec
doc: The scope is not specified.
-
name: netdev
doc: The main shaper for the given network device.
-
name: queue
doc: |
The shaper is attached to the given device queue,
the @id represents the queue number.
-
name: node
doc: |
The shaper allows grouping of queues or other
node shapers; can be nested in either @netdev
shapers or other @node shapers, allowing placement
in any location of the scheduling tree, except
leaves and root.
-
type: enum
name: metric
doc: Different metric supported by the shaper.
entries:
-
name: bps
doc: Shaper operates on a bits per second basis.
-
name: pps
doc: Shaper operates on a packets per second basis.
attribute-sets:
-
name: net-shaper
attributes:
-
name: handle
type: nest
nested-attributes: handle
doc: Unique identifier for the given shaper inside the owning device.
-
name: metric
type: u32
enum: metric
doc: Metric used by the given shaper for bw-min, bw-max and burst.
-
name: bw-min
type: uint
doc: Guaranteed bandwidth for the given shaper.
-
name: bw-max
type: uint
doc: Maximum bandwidth for the given shaper or 0 when unlimited.
-
name: burst
type: uint
doc: |
Maximum burst-size for shaping. Should not be interpreted
as a quantum.
-
name: priority
type: u32
doc: |
Scheduling priority for the given shaper. The priority
scheduling is applied to sibling shapers.
-
name: weight
type: u32
doc: |
Relative weight for round robin scheduling of the
given shaper.
The scheduling is applied to all sibling shapers
with the same priority.
-
name: ifindex
type: u32
doc: Interface index owning the specified shaper.
-
name: parent
type: nest
nested-attributes: handle
doc: |
Identifier for the parent of the affected shaper.
Only needed for @group operation.
-
name: leaves
type: nest
multi-attr: true
nested-attributes: leaf-info
doc: |
Describes a set of leaves shapers for a @group operation.
-
name: handle
attributes:
-
name: scope
type: u32
enum: scope
doc: Defines the shaper @id interpretation.
-
name: id
type: u32
checks:
max: max-handle-id
doc: |
Numeric identifier of a shaper. The id semantic depends on
the scope. For @queue scope it's the queue id and for @node
scope it's the node identifier.
-
name: leaf-info
subset-of: net-shaper
attributes:
-
name: handle
-
name: priority
-
name: weight
-
name: caps
attributes:
-
name: ifindex
type: u32
doc: Interface index queried for shapers capabilities.
-
name: scope
type: u32
enum: scope
doc: The scope to which the queried capabilities apply.
-
name: support-metric-bps
type: flag
doc: The device accepts 'bps' metric for bw-min, bw-max and burst.
-
name: support-metric-pps
type: flag
doc: The device accepts 'pps' metric for bw-min, bw-max and burst.
-
name: support-nesting
type: flag
doc: |
The device supports nesting shaper belonging to this scope
below 'node' scoped shapers. Only 'queue' and 'node'
scope can have flag 'support-nesting'.
-
name: support-bw-min
type: flag
doc: The device supports a minimum guaranteed B/W.
-
name: support-bw-max
type: flag
doc: The device supports maximum B/W shaping.
-
name: support-burst
type: flag
doc: The device supports a maximum burst size.
-
name: support-priority
type: flag
doc: The device supports priority scheduling.
-
name: support-weight
type: flag
doc: The device supports weighted round robin scheduling.
operations:
list:
-
name: get
doc: |
Get information about a shaper for a given device.
attribute-set: net-shaper
do:
pre: net-shaper-nl-pre-doit
post: net-shaper-nl-post-doit
request:
attributes: &ns-binding
- ifindex
- handle
reply:
attributes: &ns-attrs
- ifindex
- parent
- handle
- metric
- bw-min
- bw-max
- burst
- priority
- weight
dump:
pre: net-shaper-nl-pre-dumpit
post: net-shaper-nl-post-dumpit
request:
attributes:
- ifindex
reply:
attributes: *ns-attrs
-
name: set
doc: |
Create or update the specified shaper.
The set operation can't be used to create a @node scope shaper,
use the @group operation instead.
attribute-set: net-shaper
flags: [admin-perm]
do:
pre: net-shaper-nl-pre-doit-write
post: net-shaper-nl-post-doit-write
request:
attributes:
- ifindex
- handle
- metric
- bw-min
- bw-max
- burst
- priority
- weight
-
name: delete
doc: |
Clear (remove) the specified shaper. When deleting
a @node shaper, reattach all the node's leaves to the
deleted node's parent.
If, after the removal, the parent shaper has no more
leaves and the parent shaper scope is @node, the parent
node is deleted, recursively.
When deleting a @queue shaper or a @netdev shaper,
the shaper disappears from the hierarchy, but the
queue/device can still send traffic: it has an implicit
node with infinite bandwidth. The queue's implicit node
feeds an implicit RR node at the root of the hierarchy.
attribute-set: net-shaper
flags: [admin-perm]
do:
pre: net-shaper-nl-pre-doit-write
post: net-shaper-nl-post-doit-write
request:
attributes: *ns-binding
-
name: group
doc: |
Create or update a scheduling group, attaching the specified
@leaves shapers under the specified node identified by @handle.
The @leaves shapers scope must be @queue and the node shaper
scope must be either @node or @netdev.
When the node shaper has @node scope, if the @handle @id is not
specified, a new shaper of such scope is created, otherwise the
specified node must already exist.
When updating an existing node shaper, the specified @leaves are
added to the existing node; such node will also retain any preexisting
leave.
The @parent handle for a new node shaper defaults to the parent
of all the leaves, provided all the leaves share the same parent.
Otherwise @parent handle must be specified.
The user can optionally provide shaping attributes for the node
shaper.
The operation is atomic, on failure no change is applied to
the device shaping configuration, otherwise the @node shaper
full identifier, comprising @binding and @handle, is provided
as the reply.
attribute-set: net-shaper
flags: [admin-perm]
do:
pre: net-shaper-nl-pre-doit-write
post: net-shaper-nl-post-doit-write
request:
attributes:
- ifindex
- parent
- handle
- metric
- bw-min
- bw-max
- burst
- priority
- weight
- leaves
reply:
attributes: *ns-binding
-
name: cap-get
doc: |
Get the shaper capabilities supported by the given device
for the specified scope.
attribute-set: caps
do:
pre: net-shaper-nl-cap-pre-doit
post: net-shaper-nl-cap-post-doit
request:
attributes:
- ifindex
- scope
reply:
attributes: &cap-attrs
- ifindex
- scope
- support-metric-bps
- support-metric-pps
- support-nesting
- support-bw-min
- support-bw-max
- support-burst
- support-priority
- support-weight
dump:
pre: net-shaper-nl-cap-pre-dumpit
post: net-shaper-nl-cap-post-dumpit
request:
attributes:
- ifindex
reply:
attributes: *cap-attrs
@@ -0,0 +1,869 @@
# SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)
---
name: netdev
doc: >-
netdev configuration over generic netlink.
definitions:
-
type: flags
name: xdp-act
render-max: true
entries:
-
name: basic
doc: >-
XDP features set supported by all drivers
(XDP_ABORTED, XDP_DROP, XDP_PASS, XDP_TX)
-
name: redirect
doc: >-
The netdev supports XDP_REDIRECT
-
name: ndo-xmit
doc: >-
This feature informs if netdev implements ndo_xdp_xmit callback.
-
name: xsk-zerocopy
doc: >-
This feature informs if netdev supports AF_XDP in zero copy mode.
-
name: hw-offload
doc: >-
This feature informs if netdev supports XDP hw offloading.
-
name: rx-sg
doc: >-
This feature informs if netdev implements non-linear XDP buffer
support in the driver napi callback.
-
name: ndo-xmit-sg
doc: >-
This feature informs if netdev implements non-linear XDP buffer
support in ndo_xdp_xmit callback.
-
type: flags
name: xdp-rx-metadata
entries:
-
name: timestamp
doc: |
Device is capable of exposing receive HW timestamp via
bpf_xdp_metadata_rx_timestamp().
-
name: hash
doc: |
Device is capable of exposing receive packet hash via
bpf_xdp_metadata_rx_hash().
-
name: vlan-tag
doc: |
Device is capable of exposing receive packet VLAN tag via
bpf_xdp_metadata_rx_vlan_tag().
-
type: flags
name: xsk-flags
entries:
-
name: tx-timestamp
doc: >-
HW timestamping egress packets is supported by the driver.
-
name: tx-checksum
doc: >-
L3 checksum HW offload is supported by the driver.
-
name: tx-launch-time-fifo
doc: >-
Launch time HW offload is supported by the driver.
-
name: queue-type
type: enum
entries: [rx, tx]
-
name: qstats-scope
type: flags
entries: [queue]
-
name: napi-threaded
type: enum
entries: [disabled, enabled, busy-poll]
attribute-sets:
-
name: dev
attributes:
-
name: ifindex
doc: netdev ifindex
type: u32
checks:
min: 1
-
name: pad
type: pad
-
name: xdp-features
doc: Bitmask of enabled xdp-features.
type: u64
enum: xdp-act
-
name: xdp-zc-max-segs
doc: max fragment count supported by ZC driver
type: u32
checks:
min: 1
-
name: xdp-rx-metadata-features
doc: Bitmask of supported XDP receive metadata features.
See Documentation/networking/xdp-rx-metadata.rst for more details.
type: u64
enum: xdp-rx-metadata
-
name: xsk-features
doc: Bitmask of enabled AF_XDP features.
type: u64
enum: xsk-flags
-
name: io-uring-provider-info
attributes:
-
name: rx-buf-len
type: uint
doc: |
RX buffer length in bytes for this io_uring memory provider.
Reflects the rx_buf_len passed at io_uring zerocopy rx
registration time.
-
name: page-pool
attributes:
-
name: id
doc: Unique ID of a Page Pool instance.
type: uint
checks:
min: 1
max: u32-max
-
name: ifindex
doc: |
ifindex of the netdev to which the pool belongs.
May not be reported if the page pool was allocated for a netdev
which got destroyed already (page pools may outlast their netdevs
because they wait for all memory to be returned).
type: u32
checks:
min: 1
max: s32-max
-
name: napi-id
doc: Id of NAPI using this Page Pool instance.
type: uint
checks:
min: 1
max: u32-max
-
name: inflight
type: uint
doc: |
Number of outstanding references to this page pool (allocated
but yet to be freed pages). Allocated pages may be held in
socket receive queues, driver receive ring, page pool recycling
ring, the page pool cache, etc.
-
name: inflight-mem
type: uint
doc: |
Amount of memory held by inflight pages.
-
name: detach-time
type: uint
doc: |
Seconds in CLOCK_BOOTTIME of when Page Pool was detached by
the driver. Once detached Page Pool can no longer be used to
allocate memory.
Page Pools wait for all the memory allocated from them to be freed
before truly disappearing. "Detached" Page Pools cannot be
"re-attached", they are just waiting to disappear.
Attribute is absent if Page Pool has not been detached, and
can still be used to allocate new memory.
-
name: dmabuf
doc: ID of the dmabuf this page-pool is attached to.
type: u32
-
name: io-uring
doc: io-uring memory provider information.
type: nest
nested-attributes: io-uring-provider-info
-
name: page-pool-info
subset-of: page-pool
attributes:
-
name: id
-
name: ifindex
-
name: page-pool-stats
doc: |
Page pool statistics, see docs for struct page_pool_stats
for information about individual statistics.
attributes:
-
name: info
doc: Page pool identifying information.
type: nest
nested-attributes: page-pool-info
-
name: alloc-fast
type: uint
value: 8 # reserve some attr ids in case we need more metadata later
-
name: alloc-slow
type: uint
-
name: alloc-slow-high-order
type: uint
-
name: alloc-empty
type: uint
-
name: alloc-refill
type: uint
-
name: alloc-waive
type: uint
-
name: recycle-cached
type: uint
-
name: recycle-cache-full
type: uint
-
name: recycle-ring
type: uint
-
name: recycle-ring-full
type: uint
-
name: recycle-released-refcnt
type: uint
-
name: napi
attributes:
-
name: ifindex
doc: ifindex of the netdevice to which NAPI instance belongs.
type: u32
checks:
min: 1
-
name: id
doc: ID of the NAPI instance.
type: u32
-
name: irq
doc: The associated interrupt vector number for the napi
type: u32
-
name: pid
doc: PID of the napi thread, if NAPI is configured to operate in
threaded mode. If NAPI is not in threaded mode (i.e. uses normal
softirq context), the attribute will be absent.
type: u32
-
name: defer-hard-irqs
doc: The number of consecutive empty polls before IRQ deferral ends
and hardware IRQs are re-enabled.
type: u32
checks:
max: s32-max
-
name: gro-flush-timeout
doc: The timeout, in nanoseconds, of when to trigger the NAPI watchdog
timer which schedules NAPI processing. Additionally, a non-zero
value will also prevent GRO from flushing recent super-frames at
the end of a NAPI cycle. This may add receive latency in exchange
for reducing the number of frames processed by the network stack.
type: uint
-
name: irq-suspend-timeout
doc: The timeout, in nanoseconds, of how long to suspend irq
processing, if event polling finds events
type: uint
-
name: threaded
doc: Whether the NAPI is configured to operate in threaded polling
mode. If this is set to enabled then the NAPI context operates
in threaded polling mode. If this is set to busy-poll, then the
threaded polling mode also busy polls.
type: u32
enum: napi-threaded
-
name: xsk-info
attributes: []
-
name: queue
attributes:
-
name: id
doc: Queue index; most queue types are indexed like a C array, with
indexes starting at 0 and ending at queue count - 1. Queue indexes
are scoped to an interface and queue type.
type: u32
-
name: ifindex
doc: ifindex of the netdevice to which the queue belongs.
type: u32
checks:
min: 1
-
name: type
doc: Queue type as rx, tx. Each queue type defines a separate ID space.
XDP TX queues allocated in the kernel are not linked to NAPIs and
thus not listed. AF_XDP queues will have more information set in
the xsk attribute.
type: u32
enum: queue-type
-
name: napi-id
doc: ID of the NAPI instance which services this queue.
type: u32
-
name: dmabuf
doc: ID of the dmabuf attached to this queue, if any.
type: u32
-
name: io-uring
doc: io_uring memory provider information.
type: nest
nested-attributes: io-uring-provider-info
-
name: xsk
doc: XSK information for this queue, if any.
type: nest
nested-attributes: xsk-info
-
name: lease
doc: |
A queue from a virtual device can have a lease which refers to
another queue from a physical device. This is useful for memory
providers and AF_XDP operations which take an ifindex and queue id
to allow applications to bind against virtual devices in containers.
type: nest
nested-attributes: lease
-
name: qstats
doc: |
Get device statistics, scoped to a device or a queue.
These statistics extend (and partially duplicate) statistics available
in struct rtnl_link_stats64.
Value of the `scope` attribute determines how statistics are
aggregated. When aggregated for the entire device the statistics
represent the total number of events since last explicit reset of
the device (i.e. not a reconfiguration like changing queue count).
When reported per-queue, however, the statistics may not add
up to the total number of events, will only be reported for currently
active objects, and will likely report the number of events since last
reconfiguration.
attributes:
-
name: ifindex
doc: ifindex of the netdevice to which stats belong.
type: u32
checks:
min: 1
-
name: queue-type
doc: Queue type as rx, tx, for queue-id.
type: u32
enum: queue-type
-
name: queue-id
doc: Queue ID, if stats are scoped to a single queue instance.
type: u32
-
name: scope
doc: |
What object type should be used to iterate over the stats.
type: uint
enum: qstats-scope
-
name: rx-packets
doc: |
Number of wire packets successfully received and passed to the stack.
For drivers supporting XDP, XDP is considered the first layer
of the stack, so packets consumed by XDP are still counted here.
type: uint
value: 8 # reserve some attr ids in case we need more metadata later
-
name: rx-bytes
doc: Successfully received bytes, see `rx-packets`.
type: uint
-
name: tx-packets
doc: |
Number of wire packets successfully sent. Packet is considered to be
successfully sent once it is in device memory (usually this means
the device has issued a DMA completion for the packet).
type: uint
-
name: tx-bytes
doc: Successfully sent bytes, see `tx-packets`.
type: uint
-
name: rx-alloc-fail
doc: |
Number of times skb or buffer allocation failed on the Rx datapath.
Allocation failure may, or may not result in a packet drop, depending
on driver implementation and whether system recovers quickly.
type: uint
-
name: rx-hw-drops
doc: |
Number of all packets which entered the device, but never left it,
including but not limited to: packets dropped due to lack of buffer
space, processing errors, explicit or implicit policies and packet
filters.
type: uint
-
name: rx-hw-drop-overruns
doc: |
Number of packets dropped due to transient lack of resources, such as
buffer space, host descriptors etc.
type: uint
-
name: rx-csum-complete
doc: Number of packets that were marked as CHECKSUM_COMPLETE.
type: uint
-
name: rx-csum-unnecessary
doc: Number of packets that were marked as CHECKSUM_UNNECESSARY.
type: uint
-
name: rx-csum-none
doc: Number of packets that were not checksummed by device.
type: uint
-
name: rx-csum-bad
doc: |
Number of packets with bad checksum. The packets are not discarded,
but still delivered to the stack.
type: uint
-
name: rx-hw-gro-packets
doc: |
Number of packets that were coalesced from smaller packets by the
device. Counts only packets coalesced with the HW-GRO netdevice
feature, LRO-coalesced packets are not counted.
type: uint
-
name: rx-hw-gro-bytes
doc: See `rx-hw-gro-packets`.
type: uint
-
name: rx-hw-gro-wire-packets
doc: |
Number of packets that were coalesced to bigger packetss with the
HW-GRO netdevice feature. LRO-coalesced packets are not counted.
type: uint
-
name: rx-hw-gro-wire-bytes
doc: See `rx-hw-gro-wire-packets`.
type: uint
-
name: rx-hw-drop-ratelimits
doc: |
Number of the packets dropped by the device due to the received
packets bitrate exceeding the device rate limit.
type: uint
-
name: tx-hw-drops
doc: |
Number of packets that arrived at the device but never left it,
encompassing packets dropped for reasons such as processing errors, as
well as those affected by explicitly defined policies and packet
filtering criteria.
type: uint
-
name: tx-hw-drop-errors
doc: Number of packets dropped because they were invalid or malformed.
type: uint
-
name: tx-csum-none
doc: |
Number of packets that did not require the device to calculate the
checksum.
type: uint
-
name: tx-needs-csum
doc: |
Number of packets that required the device to calculate the checksum.
This counter includes the number of GSO wire packets for which device
calculated the L4 checksum.
type: uint
-
name: tx-hw-gso-packets
doc: |
Number of packets that necessitated segmentation into smaller packets
by the device.
type: uint
-
name: tx-hw-gso-bytes
doc: See `tx-hw-gso-packets`.
type: uint
-
name: tx-hw-gso-wire-packets
doc: |
Number of wire-sized packets generated by processing
`tx-hw-gso-packets`
type: uint
-
name: tx-hw-gso-wire-bytes
doc: See `tx-hw-gso-wire-packets`.
type: uint
-
name: tx-hw-drop-ratelimits
doc: |
Number of the packets dropped by the device due to the transmit
packets bitrate exceeding the device rate limit.
type: uint
-
name: tx-stop
doc: |
Number of times driver paused accepting new tx packets
from the stack to this queue, because the queue was full.
Note that if BQL is supported and enabled on the device
the networking stack will avoid queuing a lot of data at once.
type: uint
-
name: tx-wake
doc: |
Number of times driver re-started accepting send
requests to this queue from the stack.
type: uint
-
name: queue-id
subset-of: queue
attributes:
-
name: id
-
name: type
-
name: lease
attributes:
-
name: ifindex
doc: The netdev ifindex to lease the queue from.
type: u32
checks:
min: 1
-
name: queue
doc: The netdev queue to lease from.
type: nest
nested-attributes: queue-id
-
name: netns-id
doc: The network namespace id of the netdev.
type: s32
checks:
min: 0
-
name: dmabuf
attributes:
-
name: ifindex
doc: netdev ifindex to bind the dmabuf to.
type: u32
checks:
min: 1
-
name: queues
doc: receive queues to bind the dmabuf to.
type: nest
nested-attributes: queue-id
multi-attr: true
-
name: fd
doc: dmabuf file descriptor to bind.
type: u32
-
name: id
doc: id of the dmabuf binding
type: u32
checks:
min: 1
operations:
list:
-
name: dev-get
doc: Get / dump information about a netdev.
attribute-set: dev
do:
request:
attributes:
- ifindex
reply: &dev-all
attributes:
- ifindex
- xdp-features
- xdp-zc-max-segs
- xdp-rx-metadata-features
- xsk-features
dump:
reply: *dev-all
-
name: dev-add-ntf
doc: Notification about device appearing.
notify: dev-get
mcgrp: mgmt
-
name: dev-del-ntf
doc: Notification about device disappearing.
notify: dev-get
mcgrp: mgmt
-
name: dev-change-ntf
doc: Notification about device configuration being changed.
notify: dev-get
mcgrp: mgmt
-
name: page-pool-get
doc: |
Get / dump information about Page Pools.
Only Page Pools associated by the driver with a net_device
can be listed. ifindex will not be reported if the net_device
no longer exists.
attribute-set: page-pool
do:
request:
attributes:
- id
reply: &pp-reply
attributes:
- id
- ifindex
- napi-id
- inflight
- inflight-mem
- detach-time
- dmabuf
- io-uring
dump:
request:
attributes:
- ifindex
reply: *pp-reply
config-cond: page-pool
-
name: page-pool-add-ntf
doc: Notification about page pool appearing.
notify: page-pool-get
mcgrp: page-pool
config-cond: page-pool
-
name: page-pool-del-ntf
doc: Notification about page pool disappearing.
notify: page-pool-get
mcgrp: page-pool
config-cond: page-pool
-
name: page-pool-change-ntf
doc: Notification about page pool configuration being changed.
notify: page-pool-get
mcgrp: page-pool
config-cond: page-pool
-
name: page-pool-stats-get
doc: Get page pool statistics.
attribute-set: page-pool-stats
do:
request:
attributes:
- info
reply: &pp-stats-reply
attributes:
- info
- alloc-fast
- alloc-slow
- alloc-slow-high-order
- alloc-empty
- alloc-refill
- alloc-waive
- recycle-cached
- recycle-cache-full
- recycle-ring
- recycle-ring-full
- recycle-released-refcnt
dump:
request:
attributes:
- info
reply: *pp-stats-reply
config-cond: page-pool-stats
-
name: queue-get
doc: Get queue information from the kernel.
Only configured queues will be reported (as opposed to all available
hardware queues).
attribute-set: queue
do:
request:
attributes:
- ifindex
- type
- id
reply: &queue-get-op
attributes:
- id
- type
- napi-id
- ifindex
- dmabuf
- io-uring
- xsk
- lease
dump:
request:
attributes:
- ifindex
reply: *queue-get-op
-
name: napi-get
doc: Get information about NAPI instances configured on the system.
attribute-set: napi
do:
request:
attributes:
- id
reply: &napi-get-op
attributes:
- id
- ifindex
- irq
- pid
- defer-hard-irqs
- gro-flush-timeout
- irq-suspend-timeout
- threaded
dump:
request:
attributes:
- ifindex
reply: *napi-get-op
-
name: qstats-get
doc: |
Get / dump fine grained statistics. Which statistics are reported
depends on the device and the driver, and whether the driver stores
software counters per-queue.
attribute-set: qstats
dump:
request:
attributes:
- ifindex
- scope
reply:
attributes:
- ifindex
- queue-type
- queue-id
- rx-packets
- rx-bytes
- tx-packets
- tx-bytes
- rx-alloc-fail
- rx-hw-drops
- rx-hw-drop-overruns
- rx-csum-complete
- rx-csum-unnecessary
- rx-csum-none
- rx-csum-bad
- rx-hw-gro-packets
- rx-hw-gro-bytes
- rx-hw-gro-wire-packets
- rx-hw-gro-wire-bytes
- rx-hw-drop-ratelimits
- tx-hw-drops
- tx-hw-drop-errors
- tx-csum-none
- tx-needs-csum
- tx-hw-gso-packets
- tx-hw-gso-bytes
- tx-hw-gso-wire-packets
- tx-hw-gso-wire-bytes
- tx-hw-drop-ratelimits
- tx-stop
- tx-wake
-
name: bind-rx
doc: Bind dmabuf to netdev
attribute-set: dmabuf
flags: [uns-admin-perm]
do:
request:
attributes:
- ifindex
- fd
- queues
reply:
attributes:
- id
-
name: napi-set
doc: Set configurable NAPI instance settings.
attribute-set: napi
flags: [admin-perm]
do:
request:
attributes:
- id
- defer-hard-irqs
- gro-flush-timeout
- irq-suspend-timeout
- threaded
-
name: bind-tx
doc: Bind dmabuf to netdev for TX
attribute-set: dmabuf
do:
request:
attributes:
- ifindex
- fd
reply:
attributes:
- id
-
name: queue-create
doc: |
Create a new queue for the given netdevice. Whether this operation
is supported depends on the device and the driver.
attribute-set: queue
flags: [admin-perm]
do:
request:
attributes:
- ifindex
- type
- lease
reply: &queue-create-op
attributes:
- id
kernel-family:
headers: ["net/netdev_netlink.h"]
sock-priv: struct netdev_nl_sock
mcast-groups:
list:
-
name: mgmt
-
name: page-pool
@@ -0,0 +1,525 @@
# SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)
---
name: nfsd
protocol: genetlink
uapi-header: linux/nfsd_netlink.h
doc: NFSD configuration over generic netlink.
definitions:
-
type: flags
name: cache-type
entries: [svc_export, expkey]
-
type: flags
name: export-flags
doc: These flags are ordered to match the NFSEXP_* flags in include/linux/nfsd/export.h
entries:
- readonly
- insecure-port
- rootsquash
- allsquash
- async
- gathered-writes
- noreaddirplus
- security-label
- sign-fh
- nohide
- nosubtreecheck
- noauthnlm
- msnfs
- fsid
- crossmount
- noacl
- v4root
- pnfs
-
type: flags
name: xprtsec-mode
doc: These flags are ordered to match the NFSEXP_XPRTSEC_* flags in include/linux/nfsd/export.h
entries:
- none
- tls
- mtls
attribute-sets:
-
name: cache-notify
attributes:
-
name: cache-type
type: u32
enum: cache-type
-
name: rpc-status
attributes:
-
name: xid
type: u32
byte-order: big-endian
-
name: flags
type: u32
-
name: prog
type: u32
-
name: version
type: u8
-
name: proc
type: u32
-
name: service-time
type: s64
-
name: pad
type: pad
-
name: saddr4
type: u32
byte-order: big-endian
display-hint: ipv4
-
name: daddr4
type: u32
byte-order: big-endian
display-hint: ipv4
-
name: saddr6
type: binary
display-hint: ipv6
-
name: daddr6
type: binary
display-hint: ipv6
-
name: sport
type: u16
byte-order: big-endian
-
name: dport
type: u16
byte-order: big-endian
-
name: compound-ops
type: u32
multi-attr: true
-
name: server
attributes:
-
name: threads
type: u32
multi-attr: true
-
name: gracetime
type: u32
-
name: leasetime
type: u32
-
name: scope
type: string
-
name: min-threads
type: u32
-
name: fh-key
type: binary
checks:
exact-len: 16
-
name: version
attributes:
-
name: major
type: u32
-
name: minor
type: u32
-
name: enabled
type: flag
-
name: server-proto
attributes:
-
name: version
type: nest
nested-attributes: version
multi-attr: true
-
name: sock
attributes:
-
name: addr
type: binary
-
name: transport-name
type: string
-
name: server-sock
attributes:
-
name: addr
type: nest
nested-attributes: sock
multi-attr: true
-
name: pool-mode
attributes:
-
name: mode
type: string
-
name: npools
type: u32
-
name: fslocation
attributes:
-
name: host
type: string
-
name: path
type: string
-
name: fslocations
attributes:
-
name: location
type: nest
nested-attributes: fslocation
multi-attr: true
-
name: auth-flavor
attributes:
-
name: pseudoflavor
type: u32
-
name: flags
type: u32
enum: export-flags
enum-as-flags: true
-
name: svc-export
attributes:
-
name: seqno
type: u64
-
name: client
type: string
-
name: path
type: string
-
name: negative
type: flag
-
name: expiry
type: u64
-
name: anon-uid
type: u32
-
name: anon-gid
type: u32
-
name: fslocations
type: nest
nested-attributes: fslocations
-
name: uuid
type: binary
-
name: secinfo
type: nest
nested-attributes: auth-flavor
multi-attr: true
-
name: xprtsec
type: u32
enum: xprtsec-mode
multi-attr: true
-
name: flags
type: u32
enum: export-flags
enum-as-flags: true
-
name: fsid
type: s32
-
name: svc-export-reqs
attributes:
-
name: requests
type: nest
nested-attributes: svc-export
multi-attr: true
-
name: expkey
attributes:
-
name: seqno
type: u64
-
name: client
type: string
-
name: fsidtype
type: u8
-
name: fsid
type: binary
-
name: negative
type: flag
-
name: expiry
type: u64
-
name: path
type: string
-
name: expkey-reqs
attributes:
-
name: requests
type: nest
nested-attributes: expkey
multi-attr: true
-
name: cache-flush
attributes:
-
name: mask
type: u32
enum: cache-type
enum-as-flags: true
-
name: unlock-ip
attributes:
-
name: address
type: binary
doc: struct sockaddr_in or struct sockaddr_in6.
checks:
min-len: 16
-
name: unlock-filesystem
attributes:
-
name: path
type: string
doc: Filesystem path whose state should be released.
-
name: unlock-export
attributes:
-
name: path
type: string
doc: >-
Export path whose NFSv4 state should be revoked.
All state (opens, locks, delegations, layouts) acquired
through any export of this path is revoked, regardless
of which client holds the state. Intended for use after
all clients have been unexported from a given path,
enabling the underlying filesystem to be unmounted.
operations:
list:
-
name: rpc-status-get
doc: dump pending nfsd rpc
attribute-set: rpc-status
dump:
reply:
attributes:
- xid
- flags
- prog
- version
- proc
- service-time
- saddr4
- daddr4
- saddr6
- daddr6
- sport
- dport
- compound-ops
-
name: threads-set
doc: set the maximum number of running threads
attribute-set: server
flags: [admin-perm]
do:
request:
attributes:
- threads
- gracetime
- leasetime
- scope
- min-threads
- fh-key
-
name: threads-get
doc: get the maximum number of running threads
attribute-set: server
do:
reply:
attributes:
- threads
- gracetime
- leasetime
- scope
- min-threads
-
name: version-set
doc: set nfs enabled versions
attribute-set: server-proto
flags: [admin-perm]
do:
request:
attributes:
- version
-
name: version-get
doc: get nfs enabled versions
attribute-set: server-proto
do:
reply:
attributes:
- version
-
name: listener-set
doc: set nfs running sockets
attribute-set: server-sock
flags: [admin-perm]
do:
request:
attributes:
- addr
-
name: listener-get
doc: get nfs running listeners
attribute-set: server-sock
do:
reply:
attributes:
- addr
-
name: pool-mode-set
doc: set the current server pool-mode
attribute-set: pool-mode
flags: [admin-perm]
do:
request:
attributes:
- mode
-
name: pool-mode-get
doc: get info about server pool-mode
attribute-set: pool-mode
do:
reply:
attributes:
- mode
- npools
-
name: cache-notify
doc: Notification that there are cache requests that need servicing
attribute-set: cache-notify
mcgrp: exportd
event:
attributes:
- cache-type
-
name: svc-export-get-reqs
doc: Dump all pending svc_export requests
attribute-set: svc-export-reqs
flags: [admin-perm]
dump:
reply:
attributes:
- requests
-
name: svc-export-set-reqs
doc: Respond to one or more svc_export requests
attribute-set: svc-export-reqs
flags: [admin-perm]
do:
request:
attributes:
- requests
-
name: expkey-get-reqs
doc: Dump all pending expkey requests
attribute-set: expkey-reqs
flags: [admin-perm]
dump:
reply:
attributes:
- requests
-
name: expkey-set-reqs
doc: Respond to one or more expkey requests
attribute-set: expkey-reqs
flags: [admin-perm]
do:
request:
attributes:
- requests
-
name: cache-flush
doc: Flush nfsd caches (svc_export and/or expkey)
attribute-set: cache-flush
flags: [admin-perm]
do:
request:
attributes:
- mask
-
name: unlock-ip
doc: release NLM locks held by an IP address
attribute-set: unlock-ip
flags: [admin-perm]
do:
request:
attributes:
- address
-
name: unlock-filesystem
doc: revoke NFS state under a filesystem path
attribute-set: unlock-filesystem
flags: [admin-perm]
do:
request:
attributes:
- path
-
name: unlock-export
doc: >-
Revoke NFSv4 state acquired through exports of a given path.
Unlike unlock-filesystem, which operates at superblock granularity,
this command targets only state associated with a specific export
path. Userspace (exportfs -u) sends this after removing the last
client for a path so the underlying filesystem can be unmounted.
attribute-set: unlock-export
flags: [admin-perm]
do:
request:
attributes:
- path
mcast-groups:
list:
-
name: none
-
name: exportd
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,208 @@
# SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)
---
name: nlctrl
protocol: genetlink-legacy
uapi-header: linux/genetlink.h
doc: |
genetlink meta-family that exposes information about all genetlink
families registered in the kernel (including itself).
definitions:
-
name: op-flags
type: flags
enum-name:
entries:
- admin-perm
- cmd-cap-do
- cmd-cap-dump
- cmd-cap-haspol
- uns-admin-perm
-
name: attr-type
enum-name: netlink-attribute-type
type: enum
entries:
- invalid
- flag
- u8
- u16
- u32
- u64
- s8
- s16
- s32
- s64
- binary
- string
- nul-string
- nested
- nested-array
- bitfield32
- sint
- uint
attribute-sets:
-
name: ctrl-attrs
name-prefix: ctrl-attr-
attributes:
-
name: family-id
type: u16
-
name: family-name
type: string
-
name: version
type: u32
-
name: hdrsize
type: u32
-
name: maxattr
type: u32
-
name: ops
type: indexed-array
sub-type: nest
nested-attributes: op-attrs
-
name: mcast-groups
type: indexed-array
sub-type: nest
nested-attributes: mcast-group-attrs
-
name: policy
type: nest-type-value
type-value: [policy-id, attr-id]
nested-attributes: policy-attrs
-
name: op-policy
type: nest-type-value
type-value: [op-id]
nested-attributes: op-policy-attrs
-
name: op
type: u32
-
name: mcast-group-attrs
name-prefix: ctrl-attr-mcast-grp-
enum-name:
attributes:
-
name: name
type: string
-
name: id
type: u32
-
name: op-attrs
name-prefix: ctrl-attr-op-
enum-name:
attributes:
-
name: id
type: u32
-
name: flags
type: u32
enum: op-flags
enum-as-flags: true
-
name: policy-attrs
name-prefix: nl-policy-type-attr-
enum-name:
attributes:
-
name: type
type: u32
enum: attr-type
-
name: min-value-s
type: s64
-
name: max-value-s
type: s64
-
name: min-value-u
type: u64
-
name: max-value-u
type: u64
-
name: min-length
type: u32
-
name: max-length
type: u32
-
name: policy-idx
type: u32
-
name: policy-maxtype
type: u32
-
name: bitfield32-mask
type: u32
-
name: mask
type: u64
-
name: pad
type: pad
-
name: op-policy-attrs
name-prefix: ctrl-attr-policy-
enum-name:
attributes:
-
name: do
type: u32
-
name: dump
type: u32
operations:
enum-model: directional
name-prefix: ctrl-cmd-
list:
-
name: getfamily
doc: Get / dump genetlink families
attribute-set: ctrl-attrs
do:
request:
value: 3
attributes:
- family-name
reply: &all-attrs
value: 1
attributes:
- family-id
- family-name
- hdrsize
- maxattr
- mcast-groups
- ops
- version
dump:
reply: *all-attrs
-
name: getpolicy
doc: Get / dump genetlink policies
attribute-set: ctrl-attrs
dump:
request:
value: 10
attributes:
- family-name
- family-id
- op
reply:
value: 10
attributes:
- family-id
- op-policy
- policy
@@ -0,0 +1,533 @@
# SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)
#
# Author: Antonio Quartulli <antonio@openvpn.net>
#
# Copyright (c) 2024-2025, OpenVPN Inc.
#
---
name: ovpn
protocol: genetlink
doc: Netlink protocol to control OpenVPN network devices
definitions:
-
type: const
name: nonce-tail-size
value: 8
-
type: enum
name: cipher-alg
entries: [none, aes-gcm, chacha20-poly1305]
-
type: enum
name: del-peer-reason
entries:
- teardown
- userspace
- expired
- transport-error
- transport-disconnect
-
type: enum
name: key-slot
entries: [primary, secondary]
attribute-sets:
-
name: peer
attributes:
-
name: id
type: u32
doc: >-
The unique ID of the peer in the device context. To be used to
identify peers during operations for a specific device.
Also used to match packets received from this peer.
checks:
max: 0xFFFFFF
-
name: remote-ipv4
type: u32
doc: The remote IPv4 address of the peer
byte-order: big-endian
display-hint: ipv4
-
name: remote-ipv6
type: binary
doc: The remote IPv6 address of the peer
display-hint: ipv6
checks:
exact-len: 16
-
name: remote-ipv6-scope-id
type: u32
doc: The scope id of the remote IPv6 address of the peer (RFC2553)
-
name: remote-port
type: u16
doc: The remote port of the peer
byte-order: big-endian
checks:
min: 1
-
name: socket
type: u32
doc: The socket to be used to communicate with the peer
-
name: socket-netnsid
type: s32
doc: The ID of the netns the socket assigned to this peer lives in
-
name: vpn-ipv4
type: u32
doc: The IPv4 address assigned to the peer by the server
byte-order: big-endian
display-hint: ipv4
-
name: vpn-ipv6
type: binary
doc: The IPv6 address assigned to the peer by the server
display-hint: ipv6
checks:
exact-len: 16
-
name: local-ipv4
type: u32
doc: The local IPv4 to be used to send packets to the peer (UDP only)
byte-order: big-endian
display-hint: ipv4
-
name: local-ipv6
type: binary
doc: The local IPv6 to be used to send packets to the peer (UDP only)
display-hint: ipv6
checks:
exact-len: 16
-
name: local-port
type: u16
doc: The local port to be used to send packets to the peer (UDP only)
byte-order: big-endian
checks:
min: 1
-
name: keepalive-interval
type: u32
doc: >-
The number of seconds after which a keep alive message is sent to the
peer
checks:
max: 86400
-
name: keepalive-timeout
type: u32
doc: >-
The number of seconds from the last activity after which the peer is
assumed dead
checks:
max: 86400
-
name: del-reason
type: u32
doc: The reason why a peer was deleted
enum: del-peer-reason
-
name: vpn-rx-bytes
type: uint
doc: Number of bytes received over the tunnel
-
name: vpn-tx-bytes
type: uint
doc: Number of bytes transmitted over the tunnel
-
name: vpn-rx-packets
type: uint
doc: Number of packets received over the tunnel
-
name: vpn-tx-packets
type: uint
doc: Number of packets transmitted over the tunnel
-
name: link-rx-bytes
type: uint
doc: Number of bytes received at the transport level
-
name: link-tx-bytes
type: uint
doc: Number of bytes transmitted at the transport level
-
name: link-rx-packets
type: uint
doc: Number of packets received at the transport level
-
name: link-tx-packets
type: uint
doc: Number of packets transmitted at the transport level
-
name: tx-id
type: u32
doc: >-
The ID value used when transmitting packets to this peer. This
way outgoing packets can have a different ID than incoming ones.
Useful in multipeer-to-multipeer connections, where each peer
will advertise the tx-id to be used on the link.
checks:
max: 0xFFFFFF
-
name: peer-new-input
subset-of: peer
attributes:
-
name: id
-
name: remote-ipv4
-
name: remote-ipv6
-
name: remote-ipv6-scope-id
-
name: remote-port
-
name: socket
-
name: vpn-ipv4
-
name: vpn-ipv6
-
name: local-ipv4
-
name: local-ipv6
-
name: keepalive-interval
-
name: keepalive-timeout
-
name: tx-id
-
name: peer-set-input
subset-of: peer
attributes:
-
name: id
-
name: remote-ipv4
-
name: remote-ipv6
-
name: remote-ipv6-scope-id
-
name: remote-port
-
name: vpn-ipv4
-
name: vpn-ipv6
-
name: local-ipv4
-
name: local-ipv6
-
name: keepalive-interval
-
name: keepalive-timeout
-
name: tx-id
-
name: peer-del-input
subset-of: peer
attributes:
-
name: id
-
name: keyconf
attributes:
-
name: peer-id
type: u32
doc: >-
The unique ID of the peer in the device context. To be used to
identify peers during key operations
checks:
max: 0xFFFFFF
-
name: slot
type: u32
doc: The slot where the key should be stored
enum: key-slot
-
name: key-id
doc: >-
The unique ID of the key in the peer context. Used to fetch the
correct key upon decryption
type: u32
checks:
max: 7
-
name: cipher-alg
type: u32
doc: The cipher to be used when communicating with the peer
enum: cipher-alg
-
name: encrypt-dir
type: nest
doc: Key material for encrypt direction
nested-attributes: keydir
-
name: decrypt-dir
type: nest
doc: Key material for decrypt direction
nested-attributes: keydir
-
name: keydir
attributes:
-
name: cipher-key
type: binary
doc: The actual key to be used by the cipher
checks:
max-len: 256
-
name: nonce-tail
type: binary
doc: >-
Random nonce to be concatenated to the packet ID, in order to
obtain the actual cipher IV
checks:
exact-len: nonce-tail-size
-
name: keyconf-get
subset-of: keyconf
attributes:
-
name: peer-id
-
name: slot
-
name: key-id
-
name: cipher-alg
-
name: keyconf-swap-input
subset-of: keyconf
attributes:
-
name: peer-id
-
name: keyconf-del-input
subset-of: keyconf
attributes:
-
name: peer-id
-
name: slot
-
name: ovpn
attributes:
-
name: ifindex
type: u32
doc: Index of the ovpn interface to operate on
-
name: peer
type: nest
doc: >-
The peer object containing the attributed of interest for the specific
operation
nested-attributes: peer
-
name: keyconf
type: nest
doc: Peer specific cipher configuration
nested-attributes: keyconf
-
name: ovpn-peer-new-input
subset-of: ovpn
attributes:
-
name: ifindex
-
name: peer
nested-attributes: peer-new-input
-
name: ovpn-peer-set-input
subset-of: ovpn
attributes:
-
name: ifindex
-
name: peer
nested-attributes: peer-set-input
-
name: ovpn-peer-del-input
subset-of: ovpn
attributes:
-
name: ifindex
-
name: peer
nested-attributes: peer-del-input
-
name: ovpn-keyconf-get
subset-of: ovpn
attributes:
-
name: ifindex
-
name: keyconf
nested-attributes: keyconf-get
-
name: ovpn-keyconf-swap-input
subset-of: ovpn
attributes:
-
name: ifindex
-
name: keyconf
nested-attributes: keyconf-swap-input
-
name: ovpn-keyconf-del-input
subset-of: ovpn
attributes:
-
name: ifindex
-
name: keyconf
nested-attributes: keyconf-del-input
operations:
list:
-
name: peer-new
attribute-set: ovpn-peer-new-input
flags: [admin-perm]
doc: Add a remote peer
do:
pre: ovpn-nl-pre-doit
post: ovpn-nl-post-doit
request:
attributes:
- ifindex
- peer
-
name: peer-set
attribute-set: ovpn-peer-set-input
flags: [admin-perm]
doc: modify a remote peer
do:
pre: ovpn-nl-pre-doit
post: ovpn-nl-post-doit
request:
attributes:
- ifindex
- peer
-
name: peer-get
attribute-set: ovpn
flags: [admin-perm]
doc: Retrieve data about existing remote peers (or a specific one)
do:
pre: ovpn-nl-pre-doit
post: ovpn-nl-post-doit
request:
attributes:
- ifindex
- peer
reply:
attributes:
- peer
dump:
request:
attributes:
- ifindex
reply:
attributes:
- peer
-
name: peer-del
attribute-set: ovpn-peer-del-input
flags: [admin-perm]
doc: Delete existing remote peer
do:
pre: ovpn-nl-pre-doit
post: ovpn-nl-post-doit
request:
attributes:
- ifindex
- peer
-
name: peer-del-ntf
doc: Notification about a peer being deleted
notify: peer-get
mcgrp: peers
-
name: key-new
attribute-set: ovpn
flags: [admin-perm]
doc: Add a cipher key for a specific peer
do:
pre: ovpn-nl-pre-doit
post: ovpn-nl-post-doit
request:
attributes:
- ifindex
- keyconf
-
name: key-get
attribute-set: ovpn-keyconf-get
flags: [admin-perm]
doc: Retrieve non-sensitive data about peer key and cipher
do:
pre: ovpn-nl-pre-doit
post: ovpn-nl-post-doit
request:
attributes:
- ifindex
- keyconf
reply:
attributes:
- keyconf
-
name: key-swap
attribute-set: ovpn-keyconf-swap-input
flags: [admin-perm]
doc: Swap primary and secondary session keys for a specific peer
do:
pre: ovpn-nl-pre-doit
post: ovpn-nl-post-doit
request:
attributes:
- ifindex
- keyconf
-
name: key-swap-ntf
notify: key-get
doc: >-
Notification about key having exhausted its IV space and requiring
renegotiation
mcgrp: peers
-
name: key-del
attribute-set: ovpn-keyconf-del-input
flags: [admin-perm]
doc: Delete cipher key for a specific peer
do:
pre: ovpn-nl-pre-doit
post: ovpn-nl-post-doit
request:
attributes:
- ifindex
- keyconf
-
name: peer-float-ntf
doc: Notification about a peer floating (changing its remote UDP endpoint)
notify: peer-get
mcgrp: peers
mcast-groups:
list:
-
name: peers
@@ -0,0 +1,160 @@
# SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)
---
name: ovs_datapath
version: 2
protocol: genetlink-legacy
uapi-header: linux/openvswitch.h
doc: >-
OVS datapath configuration over generic netlink.
definitions:
-
name: ovs-header
type: struct
members:
-
name: dp-ifindex
type: u32
-
name: user-features
type: flags
name-prefix: ovs-dp-f-
enum-name:
entries:
-
name: unaligned
doc: Allow last Netlink attribute to be unaligned
-
name: vport-pids
doc: Allow datapath to associate multiple Netlink PIDs to each vport
-
name: tc-recirc-sharing
doc: Allow tc offload recirc sharing
-
name: dispatch-upcall-per-cpu
doc: Allow per-cpu dispatch of upcalls
-
name: ovs-dp-stats
type: struct
members:
-
name: n-hit
type: u64
-
name: n-missed
type: u64
-
name: n-lost
type: u64
-
name: n-flows
type: u64
-
name: ovs-dp-megaflow-stats
type: struct
members:
-
name: n-mask-hit
type: u64
-
name: n-masks
type: u32
-
name: padding
type: u32
-
name: n-cache-hit
type: u64
-
name: pad1
type: u64
attribute-sets:
-
name: datapath
name-prefix: ovs-dp-attr-
enum-name: ovs-datapath-attrs
attributes:
-
name: name
type: string
-
name: upcall-pid
doc: upcall pid
type: u32
-
name: stats
type: binary
struct: ovs-dp-stats
-
name: megaflow-stats
type: binary
struct: ovs-dp-megaflow-stats
-
name: user-features
type: u32
enum: user-features
enum-as-flags: true
-
name: pad
type: unused
-
name: masks-cache-size
type: u32
-
name: per-cpu-pids
type: binary
sub-type: u32
-
name: ifindex
type: u32
operations:
fixed-header: ovs-header
name-prefix: ovs-dp-cmd-
list:
-
name: get
doc: Get / dump OVS data path configuration and state
value: 3
attribute-set: datapath
do: &dp-get-op
request:
attributes:
- name
reply:
attributes:
- name
- upcall-pid
- stats
- megaflow-stats
- user-features
- masks-cache-size
- per-cpu-pids
dump: *dp-get-op
-
name: new
doc: Create new OVS data path
value: 1
attribute-set: datapath
do:
request:
attributes:
- name
- upcall-pid
- user-features
-
name: del
doc: Delete existing OVS data path
value: 2
attribute-set: datapath
do:
request:
attributes:
- name
mcast-groups:
list:
-
name: ovs_datapath
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,130 @@
# SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)
---
name: ovs_packet
version: 1
protocol: genetlink-legacy
uapi-header: linux/openvswitch.h
doc: |
OVS packet execution over generic netlink.
Only OVS_PACKET_CMD_EXECUTE is exposed as a genl operation.
OVS_PACKET_CMD_MISS and OVS_PACKET_CMD_ACTION are kernel-to-userspace
upcalls sent via genlmsg_unicast() to the vport's upcall_pid and have
no associated genl_ops or multicast group.
Several attributes in the attribute set (userdata, egress-tun-key, len)
exist for the upcall path and are not used by the EXECUTE operation.
For EXECUTE, packet, key, and actions are mandatory (kernel returns
-EINVAL without them).
definitions:
-
name: ovs-header
type: struct
members:
-
name: dp-ifindex
type: u32
attribute-sets:
-
name: packet
name-prefix: ovs-packet-attr-
enum-name: ovs-packet-attr
attributes:
-
name: packet
type: binary
doc: Packet data, from the start of the Ethernet header.
checks:
min-len: 14
-
name: key
type: binary
doc: |
Nested OVS_KEY_ATTR_* attributes, extracted flow key.
Defined as binary because the key attribute-set belongs to the
ovs_flow family spec; cross-spec references are not supported.
-
name: actions
type: binary
doc: |
Nested OVS_ACTION_ATTR_* attributes.
Defined as binary for the same reason as key.
-
name: userdata
type: binary
doc: Opaque userspace cookie from OVS_USERSPACE_ATTR_USERDATA.
-
name: egress-tun-key
type: binary
doc: Nested OVS_TUNNEL_KEY_ATTR_* for output tunnel metadata.
-
name: unused1
type: unused
-
name: unused2
type: unused
-
name: probe
type: flag
doc: Packet operation is a feature probe, error logging suppressed.
-
name: mru
type: u16
doc: Maximum received IP fragment size.
-
name: len
type: u32
doc: Packet size before truncation.
-
name: hash
type: u64
doc: Packet hash, low 32 bits are skb hash, upper bits are flags.
-
name: upcall-pid
type: u32
doc: Netlink PID to use for upcalls during EXECUTE processing.
operations:
fixed-header: ovs-header
name-prefix: ovs-packet-cmd-
list:
-
name: miss
doc: Notify userspace of a flow table miss for a received packet.
value: 1
attribute-set: packet
event:
attributes: &event-attrs
- packet
- key
- userdata
- actions
- egress-tun-key
- mru
- len
- hash
-
name: action
doc: Notify userspace as requested by an OVS_ACTION_ATTR_USERSPACE action.
value: 2
attribute-set: packet
event:
attributes: *event-attrs
-
name: execute
doc: Apply actions to a packet.
value: 3
attribute-set: packet
do:
request:
attributes:
- packet
- key
- actions
- probe
- mru
- hash
- upcall-pid
@@ -0,0 +1,172 @@
# SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)
---
name: ovs_vport
version: 2
protocol: genetlink-legacy
uapi-header: linux/openvswitch.h
doc: >-
OVS vport configuration over generic netlink.
definitions:
-
name: ovs-header
type: struct
members:
-
name: dp-ifindex
type: u32
-
name: vport-type
type: enum
enum-name: ovs-vport-type
name-prefix: ovs-vport-type-
entries: [unspec, netdev, internal, gre, vxlan, geneve]
-
name: ovs-vport-stats
type: struct
members:
-
name: rx-packets
type: u64
-
name: tx-packets
type: u64
-
name: rx-bytes
type: u64
-
name: tx-bytes
type: u64
-
name: rx-errors
type: u64
-
name: tx-errors
type: u64
-
name: rx-dropped
type: u64
-
name: tx-dropped
type: u64
attribute-sets:
-
name: vport-options
enum-name: ovs-vport-options
name-prefix: ovs-tunnel-attr-
attributes:
-
name: dst-port
type: u32
-
name: extension
type: u32
-
name: upcall-stats
enum-name: ovs-vport-upcall-attr
name-prefix: ovs-vport-upcall-attr-
attributes:
-
name: success
type: u64
value: 0
-
name: fail
type: u64
-
name: vport
name-prefix: ovs-vport-attr-
enum-name: ovs-vport-attr
attributes:
-
name: unspec
type: unused
value: 0
-
name: port-no
type: u32
-
name: type
type: u32
enum: vport-type
-
name: name
type: string
-
name: options
type: nest
nested-attributes: vport-options
-
name: upcall-pid
type: binary
sub-type: u32
-
name: stats
type: binary
struct: ovs-vport-stats
-
name: pad
type: unused
-
name: ifindex
type: u32
-
name: netnsid
type: u32
-
name: upcall-stats
type: nest
nested-attributes: upcall-stats
operations:
name-prefix: ovs-vport-cmd-
fixed-header: ovs-header
list:
-
name: new
doc: Create a new OVS vport
attribute-set: vport
do:
request:
attributes:
- name
- type
- upcall-pid
- ifindex
- options
-
name: del
doc: Delete existing OVS vport from a data path
attribute-set: vport
do:
request:
attributes:
- port-no
- type
- name
-
name: get
doc: Get / dump OVS vport configuration and state
attribute-set: vport
do: &vport-get-op
request:
attributes:
- name
reply: &dev-all
attributes:
- port-no
- type
- name
- upcall-pid
- stats
- ifindex
- netnsid
- upcall-stats
dump: *vport-get-op
mcast-groups:
list:
-
name: ovs_vport
@@ -0,0 +1,359 @@
# SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)
---
name: psp
doc:
PSP Security Protocol Generic Netlink family.
definitions:
-
type: enum
name: version
entries: [hdr0-aes-gcm-128, hdr0-aes-gcm-256,
hdr0-aes-gmac-128, hdr0-aes-gmac-256]
attribute-sets:
-
name: assoc-dev-info
attributes:
-
name: ifindex
doc: ifindex of an associated network device.
type: u32
-
name: nsid
doc: Network namespace ID of the associated device.
type: s32
-
name: dev
attributes:
-
name: id
doc: PSP device ID.
type: u32
checks:
min: 1
-
name: ifindex
doc: |
ifindex of the main netdevice linked to the PSP device,
or the ifindex to associate with the PSP device.
type: u32
-
name: psp-versions-cap
doc: Bitmask of PSP versions supported by the device.
type: u32
enum: version
enum-as-flags: true
-
name: psp-versions-ena
doc: Bitmask of currently enabled (accepted on Rx) PSP versions.
type: u32
enum: version
enum-as-flags: true
-
name: assoc-list
doc: List of associated virtual devices.
type: nest
nested-attributes: assoc-dev-info
multi-attr: true
-
name: nsid
doc: |
Network namespace ID for the device to associate/disassociate.
Optional for dev-assoc and dev-disassoc; if not present, the
device is looked up in the caller's network namespace.
type: s32
-
name: by-association
doc: |
Flag indicating the PSP device is an associated device from a
different network namespace.
Present when in associated namespace, absent when in primary/host
namespace.
type: flag
-
name: assoc
attributes:
-
name: dev-id
doc: PSP device ID.
type: u32
checks:
min: 1
-
name: version
doc: |
PSP versions (AEAD and protocol version) used by this association,
dictates the size of the key.
type: u32
enum: version
-
name: rx-key
type: nest
nested-attributes: keys
-
name: tx-key
type: nest
nested-attributes: keys
-
name: sock-fd
doc: Sockets which should be bound to the association immediately.
type: u32
-
name: keys
attributes:
-
name: key
type: binary
-
name: spi
doc: Security Parameters Index (SPI) of the association.
type: u32
-
name: stats
attributes:
-
name: dev-id
doc: PSP device ID.
type: u32
checks:
min: 1
-
name: key-rotations
type: uint
doc: |
Number of key rotations during the lifetime of the device.
Kernel statistic.
-
name: stale-events
type: uint
doc: |
Number of times a socket's Rx got shut down due to using
a key which went stale (fully rotated out).
Kernel statistic.
-
name: rx-packets
type: uint
doc: |
Number of successfully processed and authenticated PSP packets.
Device statistic (from the PSP spec).
-
name: rx-bytes
type: uint
doc: |
Number of successfully authenticated PSP bytes received, counting from
the first byte after the IV through the last byte of payload.
The fixed initial portion of the PSP header (16 bytes)
and the PSP trailer/ICV (16 bytes) are not included in this count.
Device statistic (from the PSP spec).
-
name: rx-auth-fail
type: uint
doc: |
Number of received PSP packets with unsuccessful authentication.
Device statistic (from the PSP spec).
-
name: rx-error
type: uint
doc: |
Number of received PSP packets with length/framing errors.
Device statistic (from the PSP spec).
-
name: rx-bad
type: uint
doc: |
Number of received PSP packets with miscellaneous errors
(invalid master key indicated by SPI, unsupported version, etc.)
Device statistic (from the PSP spec).
-
name: tx-packets
type: uint
doc: |
Number of successfully processed PSP packets for transmission.
Device statistic (from the PSP spec).
-
name: tx-bytes
type: uint
doc: |
Number of successfully processed PSP bytes for transmit, counting from
the first byte after the IV through the last byte of payload.
The fixed initial portion of the PSP header (16 bytes)
and the PSP trailer/ICV (16 bytes) are not included in this count.
Device statistic (from the PSP spec).
-
name: tx-error
type: uint
doc: |
Number of PSP packets for transmission with errors.
Device statistic (from the PSP spec).
operations:
list:
-
name: dev-get
doc: Get / dump information about PSP capable devices on the system.
attribute-set: dev
do:
request:
attributes:
- id
reply: &dev-all
attributes:
- id
- ifindex
- psp-versions-cap
- psp-versions-ena
- assoc-list
- by-association
pre: psp-device-get-locked
post: psp-device-unlock
dump:
reply: *dev-all
-
name: dev-add-ntf
doc: Notification about device appearing.
notify: dev-get
mcgrp: mgmt
-
name: dev-del-ntf
doc: Notification about device disappearing.
notify: dev-get
mcgrp: mgmt
-
name: dev-set
doc: Set the configuration of a PSP device.
attribute-set: dev
flags: [admin-perm]
do:
request:
attributes:
- id
- psp-versions-ena
reply:
attributes: []
pre: psp-device-get-locked-admin
post: psp-device-unlock
-
name: dev-change-ntf
doc: Notification about device configuration being changed.
notify: dev-get
mcgrp: mgmt
-
name: key-rotate
doc: Rotate the device key.
attribute-set: dev
flags: [admin-perm]
do:
request:
attributes:
- id
reply:
attributes:
- id
pre: psp-device-get-locked-admin
post: psp-device-unlock
-
name: key-rotate-ntf
doc: Notification about device key getting rotated.
notify: key-rotate
mcgrp: use
-
name: rx-assoc
doc: Allocate a new Rx key + SPI pair, associate it with a socket.
attribute-set: assoc
do:
request:
attributes:
- dev-id
- version
- sock-fd
reply:
attributes:
- dev-id
- rx-key
pre: psp-assoc-device-get-locked
post: psp-device-unlock
-
name: tx-assoc
doc: Add a PSP Tx association.
attribute-set: assoc
do:
request:
attributes:
- dev-id
- version
- tx-key
- sock-fd
reply:
attributes: []
pre: psp-assoc-device-get-locked
post: psp-device-unlock
-
name: get-stats
doc: Get device statistics.
attribute-set: stats
do:
request:
attributes:
- dev-id
reply: &stats-all
attributes:
- dev-id
- key-rotations
- stale-events
- rx-packets
- rx-bytes
- rx-auth-fail
- rx-error
- rx-bad
- tx-packets
- tx-bytes
- tx-error
pre: psp-device-get-locked
post: psp-device-unlock
dump:
reply: *stats-all
-
name: dev-assoc
doc: Associate a network device with a PSP device.
attribute-set: dev
flags: [admin-perm]
do:
request:
attributes:
- id
- ifindex
- nsid
reply:
attributes: []
pre: psp-device-get-locked-dev-assoc
post: psp-device-unlock
-
name: dev-disassoc
doc: Disassociate a network device from a PSP device.
attribute-set: dev
flags: [admin-perm]
do:
request:
attributes:
- id
- ifindex
- nsid
reply:
attributes: []
pre: psp-device-get-locked
post: psp-device-unlock
mcast-groups:
list:
-
name: mgmt
-
name: use
...
@@ -0,0 +1,195 @@
# SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)
---
name: rt-addr
protocol: netlink-raw
uapi-header: linux/rtnetlink.h
protonum: 0
doc: >-
Address configuration over rtnetlink.
definitions:
-
name: ifaddrmsg
type: struct
members:
-
name: ifa-family
type: u8
-
name: ifa-prefixlen
type: u8
-
name: ifa-flags
type: u8
enum: ifa-flags
enum-as-flags: true
-
name: ifa-scope
type: u8
-
name: ifa-index
type: u32
-
name: ifa-cacheinfo
type: struct
members:
-
name: ifa-prefered
type: u32
-
name: ifa-valid
type: u32
-
name: cstamp
type: u32
-
name: tstamp
type: u32
-
name: ifa-flags
type: flags
name-prefix: ifa-f-
enum-name:
entries:
-
name: secondary
-
name: nodad
-
name: optimistic
-
name: dadfailed
-
name: homeaddress
-
name: deprecated
-
name: tentative
-
name: permanent
-
name: managetempaddr
-
name: noprefixroute
-
name: mcautojoin
-
name: stable-privacy
attribute-sets:
-
name: addr-attrs
name-prefix: ifa-
attributes:
-
name: address
type: binary
display-hint: ipv4-or-v6
-
name: local
type: binary
display-hint: ipv4-or-v6
-
name: label
type: string
-
name: broadcast
type: u32
byte-order: big-endian
display-hint: ipv4
-
name: anycast
type: binary
-
name: cacheinfo
type: binary
struct: ifa-cacheinfo
-
name: multicast
type: binary
-
name: flags
type: u32
enum: ifa-flags
enum-as-flags: true
-
name: rt-priority
type: u32
-
name: target-netnsid
type: binary
-
name: proto
type: u8
operations:
fixed-header: ifaddrmsg
enum-model: directional
name-prefix: rtm-
list:
-
name: newaddr
doc: Add new address
attribute-set: addr-attrs
do:
request:
value: 20
attributes: &ifaddr-all
- address
- label
- local
- cacheinfo
-
name: deladdr
doc: Remove address
attribute-set: addr-attrs
do:
request:
value: 21
attributes:
- address
- local
-
name: getaddr
doc: Dump address information.
attribute-set: addr-attrs
dump:
request:
value: 22
attributes: []
reply:
value: 20
attributes: *ifaddr-all
-
name: getmulticast
doc: Get / dump IPv4/IPv6 multicast addresses.
attribute-set: addr-attrs
fixed-header: ifaddrmsg
do:
request:
value: 58
attributes: []
reply:
value: 58
attributes: &mcaddr-attrs
- multicast
- cacheinfo
dump:
request:
value: 58
attributes: []
reply:
value: 58
attributes: *mcaddr-attrs
mcast-groups:
list:
-
name: rtnlgrp-ipv4-ifaddr
value: 5
-
name: rtnlgrp-ipv6-ifaddr
value: 9
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,453 @@
# SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)
---
name: rt-neigh
protocol: netlink-raw
uapi-header: linux/rtnetlink.h
protonum: 0
doc: >-
IP neighbour management over rtnetlink.
definitions:
-
name: ndmsg
type: struct
members:
-
name: ndm-family
type: u8
-
name: ndm-pad
type: pad
len: 3
-
name: ndm-ifindex
type: s32
-
name: ndm-state
type: u16
enum: nud-state
-
name: ndm-flags
type: u8
enum: ntf-flags
-
name: ndm-type
type: u8
enum: rtm-type
-
name: ndtmsg
type: struct
members:
-
name: family
type: u8
-
name: pad
type: pad
len: 3
-
name: nud-state
type: flags
enum-name:
entries:
- incomplete
- reachable
- stale
- delay
- probe
- failed
- noarp
- permanent
-
name: ntf-flags
type: flags
enum-name:
entries:
- use
- self
- master
- proxy
- ext-learned
- offloaded
- sticky
- router
-
name: ntf-ext-flags
type: flags
enum-name:
entries:
- managed
- locked
- ext-validated
-
name: rtm-type
type: enum
enum-name:
entries:
- unspec
- unicast
- local
- broadcast
- anycast
- multicast
- blackhole
- unreachable
- prohibit
- throw
- nat
- xresolve
-
name: nda-cacheinfo
type: struct
members:
-
name: confirmed
type: u32
-
name: used
type: u32
-
name: updated
type: u32
-
name: refcnt
type: u32
-
name: ndt-config
type: struct
members:
-
name: key-len
type: u16
-
name: entry-size
type: u16
-
name: entries
type: u32
-
name: last-flush
type: u32
-
name: last-rand
type: u32
-
name: hash-rnd
type: u32
-
name: hash-mask
type: u32
-
name: hash-chain-gc
type: u32
-
name: proxy-qlen
type: u32
-
name: ndt-stats
type: struct
members:
-
name: allocs
type: u64
-
name: destroys
type: u64
-
name: hash-grows
type: u64
-
name: res-failed
type: u64
-
name: lookups
type: u64
-
name: hits
type: u64
-
name: rcv-probes-mcast
type: u64
-
name: rcv-probes-ucast
type: u64
-
name: periodic-gc-runs
type: u64
-
name: forced-gc-runs
type: u64
-
name: table-fulls
type: u64
attribute-sets:
-
name: neighbour-attrs
name-prefix: nda-
attributes:
-
name: unspec
type: binary
value: 0
-
name: dst
type: binary
display-hint: ipv4-or-v6
-
name: lladdr
type: binary
display-hint: mac
-
name: cacheinfo
type: binary
struct: nda-cacheinfo
-
name: probes
type: u32
-
name: vlan
type: u16
-
name: port
type: u16
-
name: vni
type: u32
-
name: ifindex
type: u32
-
name: master
type: u32
-
name: link-netnsid
type: s32
-
name: src-vni
type: u32
-
name: protocol
type: u8
-
name: nh-id
type: u32
-
name: fdb-ext-attrs
type: binary
-
name: flags-ext
type: u32
enum: ntf-ext-flags
-
name: ndm-state-mask
type: u16
-
name: ndm-flags-mask
type: u8
-
name: ndt-attrs
name-prefix: ndta-
attributes:
-
name: name
type: string
-
name: thresh1
type: u32
-
name: thresh2
type: u32
-
name: thresh3
type: u32
-
name: config
type: binary
struct: ndt-config
-
name: parms
type: nest
nested-attributes: ndtpa-attrs
-
name: stats
type: binary
struct: ndt-stats
-
name: gc-interval
type: u64
-
name: pad
type: pad
-
name: ndtpa-attrs
name-prefix: ndtpa-
attributes:
-
name: ifindex
type: u32
-
name: refcnt
type: u32
-
name: reachable-time
type: u64
-
name: base-reachable-time
type: u64
-
name: retrans-time
type: u64
-
name: gc-staletime
type: u64
-
name: delay-probe-time
type: u64
-
name: queue-len
type: u32
-
name: app-probes
type: u32
-
name: ucast-probes
type: u32
-
name: mcast-probes
type: u32
-
name: anycast-delay
type: u64
-
name: proxy-delay
type: u64
-
name: proxy-qlen
type: u32
-
name: locktime
type: u64
-
name: queue-lenbytes
type: u32
-
name: mcast-reprobes
type: u32
-
name: pad
type: pad
-
name: interval-probe-time-ms
type: u64
operations:
enum-model: directional
name-prefix: rtm-
list:
-
name: newneigh
doc: Add new neighbour entry
fixed-header: ndmsg
attribute-set: neighbour-attrs
do:
request:
value: 28
attributes: &neighbour-all
- dst
- lladdr
- probes
- vlan
- port
- vni
- ifindex
- master
- protocol
- nh-id
- flags-ext
- fdb-ext-attrs
-
name: delneigh
doc: Remove an existing neighbour entry
fixed-header: ndmsg
attribute-set: neighbour-attrs
do:
request:
value: 29
attributes:
- dst
- ifindex
-
name: delneigh-ntf
doc: Notify a neighbour deletion
value: 29
notify: getneigh
fixed-header: ndmsg
-
name: getneigh
doc: Get or dump neighbour entries
fixed-header: ndmsg
attribute-set: neighbour-attrs
do:
request:
value: 30
attributes:
- dst
reply:
value: 28
attributes: *neighbour-all
dump:
request:
attributes:
- ifindex
- master
reply:
value: 28
attributes: *neighbour-all
-
name: newneigh-ntf
doc: Notify a neighbour creation
value: 28
notify: getneigh
fixed-header: ndmsg
-
name: getneightbl
doc: Get or dump neighbour tables
fixed-header: ndtmsg
attribute-set: ndt-attrs
dump:
request:
value: 66
reply:
value: 64
attributes:
- name
- thresh1
- thresh2
- thresh3
- config
- parms
- stats
- gc-interval
-
name: setneightbl
doc: Set neighbour tables
fixed-header: ndtmsg
attribute-set: ndt-attrs
do:
request:
value: 67
attributes:
- name
- thresh1
- thresh2
- thresh3
- parms
- gc-interval
mcast-groups:
list:
-
name: rtnlgrp-neigh
value: 3
@@ -0,0 +1,324 @@
# SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)
---
name: rt-route
protocol: netlink-raw
uapi-header: linux/rtnetlink.h
protonum: 0
doc: >-
Route configuration over rtnetlink.
definitions:
-
name: rtm-type
name-prefix: rtn-
enum-name:
type: enum
entries:
- unspec
- unicast
- local
- broadcast
- anycast
- multicast
- blackhole
- unreachable
- prohibit
- throw
- nat
- xresolve
-
name: rtmsg
type: struct
members:
-
name: rtm-family
type: u8
-
name: rtm-dst-len
type: u8
-
name: rtm-src-len
type: u8
-
name: rtm-tos
type: u8
-
name: rtm-table
type: u8
-
name: rtm-protocol
type: u8
-
name: rtm-scope
type: u8
-
name: rtm-type
type: u8
enum: rtm-type
-
name: rtm-flags
type: u32
-
name: rta-cacheinfo
type: struct
members:
-
name: rta-clntref
type: u32
-
name: rta-lastuse
type: u32
-
name: rta-expires
type: u32
-
name: rta-error
type: u32
-
name: rta-used
type: u32
attribute-sets:
-
name: route-attrs
name-prefix: rta-
attributes:
-
name: dst
type: binary
display-hint: ipv4-or-v6
-
name: src
type: binary
display-hint: ipv4-or-v6
-
name: iif
type: u32
-
name: oif
type: u32
-
name: gateway
type: binary
display-hint: ipv4-or-v6
-
name: priority
type: u32
-
name: prefsrc
type: binary
display-hint: ipv4-or-v6
-
name: metrics
type: nest
nested-attributes: metrics
-
name: multipath
type: binary
-
name: protoinfo # not used
type: binary
-
name: flow
type: u32
-
name: cacheinfo
type: binary
struct: rta-cacheinfo
-
name: session # not used
type: binary
-
name: mp-algo # not used
type: binary
-
name: table
type: u32
-
name: mark
type: u32
-
name: mfc-stats
type: binary
-
name: via
type: binary
-
name: newdst
type: binary
-
name: pref
type: u8
-
name: encap-type
type: u16
-
name: encap
type: binary # tunnel specific nest
-
name: expires
type: u32
-
name: pad
type: binary
-
name: uid
type: u32
-
name: ttl-propagate
type: u8
-
name: ip-proto
type: u8
-
name: sport
type: u16
-
name: dport
type: u16
-
name: nh-id
type: u32
-
name: flowlabel
type: u32
byte-order: big-endian
display-hint: hex
-
name: metrics
name-prefix: rtax-
attributes:
-
name: unspec
type: unused
value: 0
-
name: lock
type: u32
-
name: mtu
type: u32
-
name: window
type: u32
-
name: rtt
type: u32
-
name: rttvar
type: u32
-
name: ssthresh
type: u32
-
name: cwnd
type: u32
-
name: advmss
type: u32
-
name: reordering
type: u32
-
name: hoplimit
type: u32
-
name: initcwnd
type: u32
-
name: features
type: u32
-
name: rto-min
type: u32
-
name: initrwnd
type: u32
-
name: quickack
type: u32
-
name: cc-algo
type: string
-
name: fastopen-no-cookie
type: u32
operations:
enum-model: directional
fixed-header: rtmsg
name-prefix: rtm-
list:
-
name: getroute
doc: Dump route information.
attribute-set: route-attrs
do:
request:
value: 26
attributes:
- src
- dst
- iif
- oif
- ip-proto
- sport
- dport
- mark
- uid
- flowlabel
reply:
value: 24
attributes: &all-route-attrs
- dst
- src
- iif
- oif
- gateway
- priority
- prefsrc
- metrics
- multipath
- flow
- cacheinfo
- table
- mark
- mfc-stats
- via
- newdst
- pref
- encap-type
- encap
- expires
- pad
- uid
- ttl-propagate
- ip-proto
- sport
- dport
- nh-id
- flowlabel
dump:
request:
value: 26
attributes: []
reply:
value: 24
attributes: *all-route-attrs
-
name: newroute
doc: Create a new route
attribute-set: route-attrs
do:
request:
value: 24
attributes: *all-route-attrs
-
name: delroute
doc: Delete an existing route
attribute-set: route-attrs
do:
request:
value: 25
attributes: *all-route-attrs
@@ -0,0 +1,275 @@
# SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)
---
name: rt-rule
protocol: netlink-raw
uapi-header: linux/fib_rules.h
protonum: 0
doc: >-
FIB rule management over rtnetlink.
definitions:
-
name: rtgenmsg
type: struct
members:
-
name: family
type: u8
-
name: pad
type: pad
len: 3
-
name: fib-rule-hdr
type: struct
members:
-
name: family
type: u8
-
name: dst-len
type: u8
-
name: src-len
type: u8
-
name: tos
type: u8
-
name: table
type: u8
-
name: res1
type: pad
len: 1
-
name: res2
type: pad
len: 1
-
name: action
type: u8
enum: fr-act
-
name: flags
type: u32
-
name: fr-act
type: enum
enum-name:
entries:
- unspec
- to-tbl
- goto
- nop
- res3
- res4
- blackhole
- unreachable
- prohibit
-
name: fib-rule-port-range
type: struct
members:
-
name: start
type: u16
-
name: end
type: u16
-
name: fib-rule-uid-range
type: struct
members:
-
name: start
type: u32
-
name: end
type: u32
attribute-sets:
-
name: fib-rule-attrs
name-prefix: fra-
attributes:
-
name: dst
type: binary
display-hint: ipv4-or-v6
-
name: src
type: binary
display-hint: ipv4-or-v6
-
name: iifname
type: string
-
name: goto
type: u32
-
name: unused2
type: pad
-
name: priority
type: u32
-
name: unused3
type: pad
-
name: unused4
type: pad
-
name: unused5
type: pad
-
name: fwmark
type: u32
display-hint: hex
-
name: flow
type: u32
-
name: tun-id
type: u64
-
name: suppress-ifgroup
type: u32
-
name: suppress-prefixlen
type: u32
display-hint: hex
-
name: table
type: u32
-
name: fwmask
type: u32
display-hint: hex
-
name: oifname
type: string
-
name: pad
type: pad
-
name: l3mdev
type: u8
-
name: uid-range
type: binary
struct: fib-rule-uid-range
-
name: protocol
type: u8
-
name: ip-proto
type: u8
-
name: sport-range
type: binary
struct: fib-rule-port-range
-
name: dport-range
type: binary
struct: fib-rule-port-range
-
name: dscp
type: u8
-
name: flowlabel
type: u32
byte-order: big-endian
display-hint: hex
-
name: flowlabel-mask
type: u32
byte-order: big-endian
display-hint: hex
-
name: sport-mask
type: u16
display-hint: hex
-
name: dport-mask
type: u16
display-hint: hex
-
name: dscp-mask
type: u8
display-hint: hex
operations:
enum-model: directional
fixed-header: fib-rule-hdr
name-prefix: rtm-
list:
-
name: newrule
doc: Add new FIB rule
attribute-set: fib-rule-attrs
do:
request:
value: 32
attributes: &fib-rule-all
- iifname
- oifname
- priority
- fwmark
- flow
- tun-id
- fwmask
- table
- suppress-prefixlen
- suppress-ifgroup
- goto
- l3mdev
- uid-range
- protocol
- ip-proto
- sport-range
- dport-range
- dscp
- flowlabel
- flowlabel-mask
- sport-mask
- dport-mask
- dscp-mask
-
name: newrule-ntf
doc: Notify a rule creation
value: 32
notify: getrule
-
name: delrule
doc: Remove an existing FIB rule
attribute-set: fib-rule-attrs
do:
request:
value: 33
attributes: *fib-rule-all
-
name: delrule-ntf
doc: Notify a rule deletion
value: 33
notify: getrule
-
name: getrule
doc: Dump all FIB rules
attribute-set: fib-rule-attrs
dump:
request:
value: 34
reply:
value: 32
attributes: *fib-rule-all
mcast-groups:
list:
-
name: rtnlgrp-ipv4-rule
value: 8
-
name: rtnlgrp-ipv6-rule
value: 19
@@ -0,0 +1,149 @@
# SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)
---
name: sunrpc
protocol: genetlink
uapi-header: linux/sunrpc_netlink.h
doc: SUNRPC cache upcall support over generic netlink.
definitions:
-
type: flags
name: cache-type
entries: [ip_map, unix_gid]
attribute-sets:
-
name: cache-notify
attributes:
-
name: cache-type
type: u32
enum: cache-type
-
name: ip-map
attributes:
-
name: seqno
type: u64
-
name: class
type: string
-
name: addr
type: string
-
name: domain
type: string
-
name: negative
type: flag
-
name: expiry
type: u64
-
name: ip-map-reqs
attributes:
-
name: requests
type: nest
nested-attributes: ip-map
multi-attr: true
-
name: unix-gid
attributes:
-
name: seqno
type: u64
-
name: uid
type: u32
-
name: gids
type: u32
multi-attr: true
-
name: negative
type: flag
-
name: expiry
type: u64
-
name: unix-gid-reqs
attributes:
-
name: requests
type: nest
nested-attributes: unix-gid
multi-attr: true
-
name: cache-flush
attributes:
-
name: mask
type: u32
enum: cache-type
enum-as-flags: true
operations:
list:
-
name: cache-notify
doc: Notification that there are cache requests that need servicing
attribute-set: cache-notify
mcgrp: exportd
event:
attributes:
- cache-type
-
name: ip-map-get-reqs
doc: Dump all pending ip_map requests
attribute-set: ip-map-reqs
flags: [admin-perm]
dump:
reply:
attributes:
- requests
-
name: ip-map-set-reqs
doc: Respond to one or more ip_map requests
attribute-set: ip-map-reqs
flags: [admin-perm]
do:
request:
attributes:
- requests
-
name: unix-gid-get-reqs
doc: Dump all pending unix_gid requests
attribute-set: unix-gid-reqs
flags: [admin-perm]
dump:
reply:
attributes:
- requests
-
name: unix-gid-set-reqs
doc: Respond to one or more unix_gid requests
attribute-set: unix-gid-reqs
flags: [admin-perm]
do:
request:
attributes:
- requests
-
name: cache-flush
doc: Flush sunrpc caches (ip_map and/or unix_gid)
attribute-set: cache-flush
flags: [admin-perm]
do:
request:
attributes:
- mask
mcast-groups:
list:
-
name: none
-
name: exportd
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,169 @@
# SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)
---
name: tcp_metrics
protocol: genetlink-legacy
doc: |
Management interface for TCP metrics.
c-family-name: tcp-metrics-genl-name
c-version-name: tcp-metrics-genl-version
max-by-define: true
kernel-policy: global
definitions:
-
name: tcp-fastopen-cookie-max
type: const
value: 16
attribute-sets:
-
name: tcp-metrics
name-prefix: tcp-metrics-attr-
attributes:
-
name: addr-ipv4
type: u32
byte-order: big-endian
display-hint: ipv4
-
name: addr-ipv6
type: binary
checks:
min-len: 16
byte-order: big-endian
display-hint: ipv6
-
name: age
type: u64
-
name: tw-tsval
type: u32
doc: unused
-
name: tw-ts-stamp
type: s32
doc: unused
-
name: vals
type: nest
nested-attributes: metrics
-
name: fopen-mss
type: u16
-
name: fopen-syn-drops
type: u16
-
name: fopen-syn-drop-ts
type: u64
-
name: fopen-cookie
type: binary
checks:
min-len: tcp-fastopen-cookie-max
-
name: saddr-ipv4
type: u32
byte-order: big-endian
display-hint: ipv4
-
name: saddr-ipv6
type: binary
checks:
min-len: 16
byte-order: big-endian
display-hint: ipv6
-
name: pad
type: pad
-
name: metrics
# Intentionally don't define the name-prefix, see below.
doc: |
Attributes with metrics. Note that the values here do not match
the TCP_METRIC_* defines in the kernel, because kernel defines
are off-by one (e.g. rtt is defined as enum 0, while netlink carries
attribute type 1).
attributes:
-
name: rtt
type: u32
doc: |
Round Trip Time (RTT), in msecs with 3 bits fractional
(left-shift by 3 to get the msec value).
-
name: rttvar
type: u32
doc: |
Round Trip Time VARiance (RTT), in msecs with 2 bits fractional
(left-shift by 2 to get the msec value).
-
name: ssthresh
type: u32
doc: Slow Start THRESHold.
-
name: cwnd
type: u32
doc: Congestion Window.
-
name: reodering
type: u32
doc: Reodering metric.
-
name: rtt-us
type: u32
doc: |
Round Trip Time (RTT), in usecs, with 3 bits fractional
(left-shift by 3 to get the msec value).
-
name: rttvar-us
type: u32
doc: |
Round Trip Time (RTT), in usecs, with 2 bits fractional
(left-shift by 3 to get the msec value).
operations:
list:
-
name: get
doc: Retrieve metrics.
attribute-set: tcp-metrics
dont-validate: [strict, dump]
do:
request: &sel_attrs
attributes:
- addr-ipv4
- addr-ipv6
- saddr-ipv4
- saddr-ipv6
reply: &all_attrs
attributes:
- addr-ipv4
- addr-ipv6
- saddr-ipv4
- saddr-ipv6
- age
- vals
- fopen-mss
- fopen-syn-drops
- fopen-syn-drop-ts
- fopen-cookie
dump:
reply: *all_attrs
-
name: del
doc: Delete metrics.
attribute-set: tcp-metrics
dont-validate: [strict, dump]
flags: [admin-perm]
do:
request: *sel_attrs
@@ -0,0 +1,206 @@
# SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)
---
name: team
protocol: genetlink-legacy
doc: |
Network team device driver.
c-family-name: team-genl-name
c-version-name: team-genl-version
kernel-policy: global
uapi-header: linux/if_team.h
definitions:
-
name: string-max-len
type: const
value: 32
-
name: genl-change-event-mc-grp-name
type: const
value: change_event
attribute-sets:
-
name: team
doc: |
The team nested layout of get/set msg looks like::
[TEAM_ATTR_LIST_OPTION]
[TEAM_ATTR_ITEM_OPTION]
[TEAM_ATTR_OPTION_*], ...
[TEAM_ATTR_ITEM_OPTION]
[TEAM_ATTR_OPTION_*], ...
...
[TEAM_ATTR_LIST_PORT]
[TEAM_ATTR_ITEM_PORT]
[TEAM_ATTR_PORT_*], ...
[TEAM_ATTR_ITEM_PORT]
[TEAM_ATTR_PORT_*], ...
...
name-prefix: team-attr-
attributes:
-
name: unspec
type: unused
value: 0
-
name: team-ifindex
type: u32
-
name: list-option
type: nest
nested-attributes: item-option
-
name: list-port
type: nest
nested-attributes: item-port
-
name: item-option
name-prefix: team-attr-item-
attr-cnt-name: __team-attr-item-option-max
attr-max-name: team-attr-item-option-max
attributes:
-
name: option-unspec
type: unused
value: 0
-
name: option
type: nest
nested-attributes: attr-option
-
name: attr-option
name-prefix: team-attr-option-
attributes:
-
name: unspec
type: unused
value: 0
-
name: name
type: string
checks:
max-len: string-max-len
unterminated-ok: true
-
name: changed
type: flag
-
name: type
type: u8
-
name: data
type: binary
-
name: removed
type: flag
-
name: port-ifindex
type: u32
doc: for per-port options
-
name: array-index
type: u32
doc: for array options
-
name: item-port
name-prefix: team-attr-item-
attr-cnt-name: __team-attr-item-port-max
attr-max-name: team-attr-item-port-max
attributes:
-
name: port-unspec
type: unused
value: 0
-
name: port
type: nest
nested-attributes: attr-port
-
name: attr-port
name-prefix: team-attr-port-
attributes:
-
name: unspec
type: unused
value: 0
-
name: ifindex
type: u32
-
name: changed
type: flag
-
name: linkup
type: flag
-
name: speed
type: u32
-
name: duplex
type: u8
-
name: removed
type: flag
operations:
list:
-
name: noop
doc: No operation
value: 0
attribute-set: team
dont-validate: [strict]
do:
# Actually it only reply the team netlink family
reply:
attributes:
- team-ifindex
-
name: options-set
doc: Set team options
attribute-set: team
dont-validate: [strict]
flags: [admin-perm]
do:
request: &option_attrs
attributes:
- team-ifindex
- list-option
reply: *option_attrs
-
name: options-get
doc: Get team options info
attribute-set: team
dont-validate: [strict]
flags: [admin-perm]
do:
request:
attributes:
- team-ifindex
reply: *option_attrs
-
name: port-list-get
doc: Get team ports info
attribute-set: team
dont-validate: [strict]
flags: [admin-perm]
do:
request:
attributes:
- team-ifindex
reply: &port_attrs
attributes:
- team-ifindex
- list-port
@@ -0,0 +1,298 @@
# SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)
---
name: wireguard
protocol: genetlink-legacy
doc: |
**Netlink protocol to control WireGuard network devices.**
The below enums and macros are for interfacing with WireGuard, using generic
netlink, with family ``WG_GENL_NAME`` and version ``WG_GENL_VERSION``. It
defines two commands: get and set. Note that while they share many common
attributes, these two commands actually accept a slightly different set of
inputs and outputs. These differences are noted under the individual
attributes.
c-family-name: wg-genl-name
c-version-name: wg-genl-version
max-by-define: true
definitions:
-
name-prefix: wg-
name: key-len
type: const
value: 32
-
name: --kernel-timespec
type: struct
header: linux/time_types.h
members:
-
name: sec
type: u64
doc: Number of seconds, since UNIX epoch.
-
name: nsec
type: u64
doc: Number of nanoseconds, after the second began.
-
name: wgdevice-flags
name-prefix: wgdevice-f-
enum-name: wgdevice-flag
type: flags
entries:
- replace-peers
-
name: wgpeer-flags
name-prefix: wgpeer-f-
enum-name: wgpeer-flag
type: flags
entries:
- remove-me
- replace-allowedips
- update-only
-
name: wgallowedip-flags
name-prefix: wgallowedip-f-
enum-name: wgallowedip-flag
type: flags
entries:
- remove-me
attribute-sets:
-
name: wgdevice
enum-name: wgdevice-attribute
name-prefix: wgdevice-a-
attr-cnt-name: --wgdevice-a-last
attributes:
-
name: unspec
type: unused
value: 0
-
name: ifindex
type: u32
-
name: ifname
type: string
checks:
max-len: 15
-
name: private-key
type: binary
doc: Set to all zeros to remove.
display-hint: hex
checks:
exact-len: wg-key-len
-
name: public-key
type: binary
display-hint: hex
checks:
exact-len: wg-key-len
-
name: flags
type: u32
doc: |
``0`` or ``WGDEVICE_F_REPLACE_PEERS`` if all current peers should be
removed prior to adding the list below.
enum: wgdevice-flags
-
name: listen-port
type: u16
doc: Set as ``0`` to choose randomly.
-
name: fwmark
type: u32
doc: Set as ``0`` to disable.
-
name: peers
type: indexed-array
sub-type: nest
nested-attributes: wgpeer
doc: |
The index/type parameter is unused on ``SET_DEVICE`` operations and is
zero on ``GET_DEVICE`` operations.
-
name: wgpeer
enum-name: wgpeer-attribute
name-prefix: wgpeer-a-
attr-cnt-name: --wgpeer-a-last
attributes:
-
name: unspec
type: unused
value: 0
-
name: public-key
type: binary
display-hint: hex
checks:
exact-len: wg-key-len
-
name: preshared-key
type: binary
doc: Set as all zeros to remove.
display-hint: hex
checks:
exact-len: wg-key-len
-
name: flags
type: u32
doc: |
``0`` and/or ``WGPEER_F_REMOVE_ME`` if the specified peer should not
exist at the end of the operation, rather than added/updated and/or
``WGPEER_F_REPLACE_ALLOWEDIPS`` if all current allowed IPs of this
peer should be removed prior to adding the list below and/or
``WGPEER_F_UPDATE_ONLY`` if the peer should only be set if it already
exists.
enum: wgpeer-flags
-
name: endpoint
type: binary
doc: struct sockaddr_in or struct sockaddr_in6
checks:
min-len: 16
-
name: persistent-keepalive-interval
type: u16
doc: Set as ``0`` to disable.
-
name: last-handshake-time
type: binary
struct: --kernel-timespec
checks:
exact-len: 16
-
name: rx-bytes
type: u64
-
name: tx-bytes
type: u64
-
name: allowedips
type: indexed-array
sub-type: nest
nested-attributes: wgallowedip
doc: |
The index/type parameter is unused on ``SET_DEVICE`` operations and is
zero on ``GET_DEVICE`` operations.
-
name: protocol-version
type: u32
doc: |
Should not be set or used at all by most users of this API, as the
most recent protocol will be used when this is unset. Otherwise,
must be set to ``1``.
-
name: wgallowedip
enum-name: wgallowedip-attribute
name-prefix: wgallowedip-a-
attr-cnt-name: --wgallowedip-a-last
attributes:
-
name: unspec
type: unused
value: 0
-
name: family
type: u16
doc: IP family, either ``AF_INET`` or ``AF_INET6``.
-
name: ipaddr
type: binary
doc: Either ``struct in_addr`` or ``struct in6_addr``.
display-hint: ipv4-or-v6
checks:
min-len: 4
-
name: cidr-mask
type: u8
-
name: flags
type: u32
doc: |
``WGALLOWEDIP_F_REMOVE_ME`` if the specified IP should be removed;
otherwise, this IP will be added if it is not already present.
enum: wgallowedip-flags
operations:
enum-name: wg-cmd
name-prefix: wg-cmd-
list:
-
name: get-device
value: 0
doc: |
Retrieve WireGuard device
~~~~~~~~~~~~~~~~~~~~~~~~~
The command should be called with one but not both of:
- ``WGDEVICE_A_IFINDEX``
- ``WGDEVICE_A_IFNAME``
The kernel will then return several messages (``NLM_F_MULTI``). It is
possible that all of the allowed IPs of a single peer will not fit
within a single netlink message. In that case, the same peer will be
written in the following message, except it will only contain
``WGPEER_A_PUBLIC_KEY`` and ``WGPEER_A_ALLOWEDIPS``. This may occur
several times in a row for the same peer. It is then up to the receiver
to coalesce adjacent peers. Likewise, it is possible that all peers will
not fit within a single message. So, subsequent peers will be sent in
following messages, except those will only contain ``WGDEVICE_A_IFNAME``
and ``WGDEVICE_A_PEERS``. It is then up to the receiver to coalesce
these messages to form the complete list of peers.
Since this is an ``NLA_F_DUMP`` command, the final message will always
be ``NLMSG_DONE``, even if an error occurs. However, this ``NLMSG_DONE``
message contains an integer error code. It is either zero or a negative
error code corresponding to the errno.
attribute-set: wgdevice
flags: [uns-admin-perm]
dump:
pre: wg-get-device-start
post: wg-get-device-done
request:
attributes:
- ifindex
- ifname
reply: &all-attrs
attributes:
- ifindex
- ifname
- private-key
- public-key
- flags
- listen-port
- fwmark
- peers
-
name: set-device
value: 1
doc: |
Set WireGuard device
~~~~~~~~~~~~~~~~~~~~
This command should be called with a wgdevice set, containing one but
not both of ``WGDEVICE_A_IFINDEX`` and ``WGDEVICE_A_IFNAME``.
It is possible that the amount of configuration data exceeds that of the
maximum message length accepted by the kernel. In that case, several
messages should be sent one after another, with each successive one
filling in information not contained in the prior. Note that if
``WGDEVICE_F_REPLACE_PEERS`` is specified in the first message, it
probably should not be specified in fragments that come after, so that
the list of peers is only cleared the first time but appended after.
Likewise for peers, if ``WGPEER_F_REPLACE_ALLOWEDIPS`` is specified in
the first message of a peer, it likely should not be specified in
subsequent fragments.
If an error occurs, ``NLMSG_ERROR`` will reply containing an errno.
attribute-set: wgdevice
flags: [uns-admin-perm]
do:
request: *all-attrs