# Family psp netlink specification

_Peios Kernel / Internals / Netlink / specs_

> Protocol reference for the psp Netlink family, generated from the Peios kernel specification.

<!-- SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) -->


<a id="rst-family-psp-netlink-specification"></a>
<a id="rst-netlink-psp"></a>

<!-- SPDX-License-Identifier: GPL-2.0 -->

<a id="rst-summary"></a>



## Summary



PSP Security Protocol Generic Netlink family.

<a id="rst-operations"></a>



## Operations

<a id="rst-dev-get"></a>
<a id="rst-psp-operation-dev-get"></a>



### dev-get



Get / dump information about PSP capable devices on the system.

- **attribute-set**:

  [dev](#rst-psp-attribute-set-dev)

- **do**:

  **request**

  - **attributes**:

    \[`id`\]

  **reply**

  - **attributes**:

    \[`id`, `ifindex`, `psp-versions-cap`, `psp-versions-ena`\]

  **pre**



  psp-device-get-locked

  **post**



  psp-device-unlock

- **dump**:

  **reply**

  - **attributes**:

    \[`id`, `ifindex`, `psp-versions-cap`, `psp-versions-ena`\]

<a id="rst-dev-add-ntf"></a>
<a id="rst-psp-operation-dev-add-ntf"></a>



### dev-add-ntf



Notification about device appearing.

- **notify**:

  dev-get

- **mcgrp**:

  mgmt

<a id="rst-dev-del-ntf"></a>
<a id="rst-psp-operation-dev-del-ntf"></a>



### dev-del-ntf



Notification about device disappearing.

- **notify**:

  dev-get

- **mcgrp**:

  mgmt

<a id="rst-dev-set"></a>
<a id="rst-psp-operation-dev-set"></a>



### dev-set



Set the configuration of a PSP device.

- **attribute-set**:

  [dev](#rst-psp-attribute-set-dev)

- **do**:

  **request**

  - **attributes**:

    \[`id`, `psp-versions-ena`\]

  **reply**

  - **attributes**:

    \[\]

  **pre**



  psp-device-get-locked

  **post**



  psp-device-unlock

<a id="rst-dev-change-ntf"></a>
<a id="rst-psp-operation-dev-change-ntf"></a>



### dev-change-ntf



Notification about device configuration being changed.

- **notify**:

  dev-get

- **mcgrp**:

  mgmt

<a id="rst-key-rotate"></a>
<a id="rst-psp-operation-key-rotate"></a>



### key-rotate



Rotate the device key.

- **attribute-set**:

  [dev](#rst-psp-attribute-set-dev)

- **do**:

  **request**

  - **attributes**:

    \[`id`\]

  **reply**

  - **attributes**:

    \[`id`\]

  **pre**



  psp-device-get-locked

  **post**



  psp-device-unlock

<a id="rst-key-rotate-ntf"></a>
<a id="rst-psp-operation-key-rotate-ntf"></a>



### key-rotate-ntf



Notification about device key getting rotated.

- **notify**:

  key-rotate

- **mcgrp**:

  use

<a id="rst-rx-assoc"></a>
<a id="rst-psp-operation-rx-assoc"></a>



### rx-assoc



Allocate a new Rx key + SPI pair, associate it with a socket.

- **attribute-set**:

  [assoc](#rst-psp-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

<a id="rst-tx-assoc"></a>
<a id="rst-psp-operation-tx-assoc"></a>



### tx-assoc



Add a PSP Tx association.

- **attribute-set**:

  [assoc](#rst-psp-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

<a id="rst-get-stats"></a>
<a id="rst-psp-operation-get-stats"></a>



### get-stats



Get device statistics.

- **attribute-set**:

  [stats](#rst-psp-attribute-set-stats)

- **do**:

  **request**

  - **attributes**:

    \[`dev-id`\]

  **reply**

  - **attributes**:

    \[`dev-id`, `key-rotations`, `stale-events`\]

  **pre**



  psp-device-get-locked

  **post**



  psp-device-unlock

- **dump**:

  **reply**

  - **attributes**:

    \[`dev-id`, `key-rotations`, `stale-events`\]

<a id="rst-multicast-groups"></a>



## Multicast groups

- mgmt


- use


<a id="rst-definitions"></a>



## Definitions

<a id="rst-version"></a>
<a id="rst-psp-definition-version"></a>



### version

- **type**:

  enum

- **entries**:

  - `hdr0-aes-gcm-128`


  - `hdr0-aes-gcm-256`


  - `hdr0-aes-gmac-128`


  - `hdr0-aes-gmac-256`

<a id="rst-attribute-sets"></a>



## Attribute sets

<a id="rst-dev"></a>
<a id="rst-psp-attribute-set-dev"></a>



### dev

<a id="rst-id-u32"></a>



#### id (`u32`)

- **doc**:

  PSP device ID.

<a id="rst-ifindex-u32"></a>



#### ifindex (`u32`)

- **doc**:

  ifindex of the main netdevice linked to the PSP device.

<a id="rst-psp-versions-cap-u32"></a>



#### psp-versions-cap (`u32`)

- **doc**:

  Bitmask of PSP versions supported by the device.

- **enum**:

  [version](#rst-psp-definition-version)

- **enum-as-flags**:

  True

<a id="rst-psp-versions-ena-u32"></a>



#### psp-versions-ena (`u32`)

- **doc**:

  Bitmask of currently enabled (accepted on Rx) PSP versions.

- **enum**:

  [version](#rst-psp-definition-version)

- **enum-as-flags**:

  True

<a id="rst-assoc"></a>
<a id="rst-psp-attribute-set-assoc"></a>



### assoc

<a id="rst-dev-id-u32"></a>



#### dev-id (`u32`)

- **doc**:

  PSP device ID.

<a id="rst-version-u32"></a>



#### version (`u32`)

- **doc**:

  PSP versions (AEAD and protocol version) used by this association, dictates the size of the key.

- **enum**:

  [version](#rst-psp-definition-version)

<a id="rst-rx-key-nest"></a>



#### rx-key (`nest`)

- **nested-attributes**:

  [keys](#rst-psp-attribute-set-keys)

<a id="rst-tx-key-nest"></a>



#### tx-key (`nest`)

- **nested-attributes**:

  [keys](#rst-psp-attribute-set-keys)

<a id="rst-sock-fd-u32"></a>



#### sock-fd (`u32`)

- **doc**:

  Sockets which should be bound to the association immediately.

<a id="rst-keys"></a>
<a id="rst-psp-attribute-set-keys"></a>



### keys

<a id="rst-key-binary"></a>



#### key (`binary`)

<a id="rst-spi-u32"></a>



#### spi (`u32`)

- **doc**:

  Security Parameters Index (SPI) of the association.

<a id="rst-stats"></a>
<a id="rst-psp-attribute-set-stats"></a>



### stats

<a id="rst-dev-id-u32-1"></a>



#### dev-id (`u32`)

- **doc**:

  PSP device ID.

<a id="rst-key-rotations-uint"></a>



#### key-rotations (`uint`)

- **doc**:

  Number of key rotations during the lifetime of the device. Kernel statistic.

<a id="rst-stale-events-uint"></a>



#### stale-events (`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.

<a id="rst-rx-packets-uint"></a>



#### rx-packets (`uint`)

- **doc**:

  Number of successfully processed and authenticated PSP packets. Device statistic (from the PSP spec).

<a id="rst-rx-bytes-uint"></a>



#### rx-bytes (`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).

<a id="rst-rx-auth-fail-uint"></a>



#### rx-auth-fail (`uint`)

- **doc**:

  Number of received PSP packets with unsuccessful authentication. Device statistic (from the PSP spec).

<a id="rst-rx-error-uint"></a>



#### rx-error (`uint`)

- **doc**:

  Number of received PSP packets with length/framing errors. Device statistic (from the PSP spec).

<a id="rst-rx-bad-uint"></a>



#### rx-bad (`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).

<a id="rst-tx-packets-uint"></a>



#### tx-packets (`uint`)

- **doc**:

  Number of successfully processed PSP packets for transmission. Device statistic (from the PSP spec).

<a id="rst-tx-bytes-uint"></a>



#### tx-bytes (`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).

<a id="rst-tx-error-uint"></a>



#### tx-error (`uint`)

- **doc**:

  Number of PSP packets for transmission with errors. Device statistic (from the PSP spec).
