xref: /linux/Documentation/netlink/specs/psp.yaml (revision 4f38da1f027ea2c9f01bb71daa7a299c191b6940)
1# SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)
2---
3name: psp
4
5doc:
6  PSP Security Protocol Generic Netlink family.
7
8definitions:
9  -
10    type: enum
11    name: version
12    entries: [hdr0-aes-gcm-128, hdr0-aes-gcm-256,
13              hdr0-aes-gmac-128, hdr0-aes-gmac-256]
14
15attribute-sets:
16  -
17    name: dev
18    attributes:
19      -
20        name: id
21        doc: PSP device ID.
22        type: u32
23        checks:
24          min: 1
25      -
26        name: ifindex
27        doc: ifindex of the main netdevice linked to the PSP device.
28        type: u32
29      -
30        name: psp-versions-cap
31        doc: Bitmask of PSP versions supported by the device.
32        type: u32
33        enum: version
34        enum-as-flags: true
35      -
36        name: psp-versions-ena
37        doc: Bitmask of currently enabled (accepted on Rx) PSP versions.
38        type: u32
39        enum: version
40        enum-as-flags: true
41  -
42    name: assoc
43    attributes:
44      -
45        name: dev-id
46        doc: PSP device ID.
47        type: u32
48        checks:
49          min: 1
50      -
51        name: version
52        doc: |
53          PSP versions (AEAD and protocol version) used by this association,
54          dictates the size of the key.
55        type: u32
56        enum: version
57      -
58        name: rx-key
59        type: nest
60        nested-attributes: keys
61      -
62        name: tx-key
63        type: nest
64        nested-attributes: keys
65      -
66        name: sock-fd
67        doc: Sockets which should be bound to the association immediately.
68        type: u32
69  -
70    name: keys
71    attributes:
72      -
73        name: key
74        type: binary
75      -
76        name: spi
77        doc: Security Parameters Index (SPI) of the association.
78        type: u32
79
80operations:
81  list:
82    -
83      name: dev-get
84      doc: Get / dump information about PSP capable devices on the system.
85      attribute-set: dev
86      do:
87        request:
88          attributes:
89            - id
90        reply: &dev-all
91          attributes:
92            - id
93            - ifindex
94            - psp-versions-cap
95            - psp-versions-ena
96        pre: psp-device-get-locked
97        post: psp-device-unlock
98      dump:
99        reply: *dev-all
100    -
101      name: dev-add-ntf
102      doc: Notification about device appearing.
103      notify: dev-get
104      mcgrp: mgmt
105    -
106      name: dev-del-ntf
107      doc: Notification about device disappearing.
108      notify: dev-get
109      mcgrp: mgmt
110    -
111      name: dev-set
112      doc: Set the configuration of a PSP device.
113      attribute-set: dev
114      do:
115        request:
116          attributes:
117            - id
118            - psp-versions-ena
119        reply:
120          attributes: []
121        pre: psp-device-get-locked
122        post: psp-device-unlock
123    -
124      name: dev-change-ntf
125      doc: Notification about device configuration being changed.
126      notify: dev-get
127      mcgrp: mgmt
128
129    -
130      name: key-rotate
131      doc: Rotate the device key.
132      attribute-set: dev
133      do:
134        request:
135          attributes:
136            - id
137        reply:
138          attributes:
139            - id
140        pre: psp-device-get-locked
141        post: psp-device-unlock
142    -
143      name: key-rotate-ntf
144      doc: Notification about device key getting rotated.
145      notify: key-rotate
146      mcgrp: use
147
148    -
149      name: rx-assoc
150      doc: Allocate a new Rx key + SPI pair, associate it with a socket.
151      attribute-set: assoc
152      do:
153        request:
154          attributes:
155            - dev-id
156            - version
157            - sock-fd
158        reply:
159          attributes:
160            - dev-id
161            - rx-key
162        pre: psp-assoc-device-get-locked
163        post: psp-device-unlock
164    -
165      name: tx-assoc
166      doc: Add a PSP Tx association.
167      attribute-set: assoc
168      do:
169        request:
170          attributes:
171            - dev-id
172            - version
173            - tx-key
174            - sock-fd
175        reply:
176          attributes: []
177        pre: psp-assoc-device-get-locked
178        post: psp-device-unlock
179
180mcast-groups:
181  list:
182    -
183      name: mgmt
184    -
185      name: use
186
187...
188