xref: /linux/Documentation/netlink/specs/nfsd.yaml (revision bba2c3615bd6cfee7456d1130f2e6b01b3f4e9ba)
1# SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)
2---
3name: nfsd
4protocol: genetlink
5uapi-header: linux/nfsd_netlink.h
6
7doc: NFSD configuration over generic netlink.
8
9definitions:
10  -
11    type: flags
12    name: cache-type
13    entries: [svc_export, expkey]
14  -
15    type: flags
16    name: export-flags
17    doc: These flags are ordered to match the NFSEXP_* flags in include/linux/nfsd/export.h
18    entries:
19      - readonly
20      - insecure-port
21      - rootsquash
22      - allsquash
23      - async
24      - gathered-writes
25      - noreaddirplus
26      - security-label
27      - sign-fh
28      - nohide
29      - nosubtreecheck
30      - noauthnlm
31      - msnfs
32      - fsid
33      - crossmount
34      - noacl
35      - v4root
36      - pnfs
37  -
38    type: flags
39    name: xprtsec-mode
40    doc: These flags are ordered to match the NFSEXP_XPRTSEC_* flags in include/linux/nfsd/export.h
41    entries:
42      - none
43      - tls
44      - mtls
45
46attribute-sets:
47  -
48    name: cache-notify
49    attributes:
50      -
51        name: cache-type
52        type: u32
53        enum: cache-type
54  -
55    name: rpc-status
56    attributes:
57      -
58        name: xid
59        type: u32
60        byte-order: big-endian
61      -
62        name: flags
63        type: u32
64      -
65        name: prog
66        type: u32
67      -
68        name: version
69        type: u8
70      -
71        name: proc
72        type: u32
73      -
74        name: service-time
75        type: s64
76      -
77        name: pad
78        type: pad
79      -
80        name: saddr4
81        type: u32
82        byte-order: big-endian
83        display-hint: ipv4
84      -
85        name: daddr4
86        type: u32
87        byte-order: big-endian
88        display-hint: ipv4
89      -
90        name: saddr6
91        type: binary
92        display-hint: ipv6
93      -
94        name: daddr6
95        type: binary
96        display-hint: ipv6
97      -
98        name: sport
99        type: u16
100        byte-order: big-endian
101      -
102        name: dport
103        type: u16
104        byte-order: big-endian
105      -
106        name: compound-ops
107        type: u32
108        multi-attr: true
109  -
110    name: server
111    attributes:
112      -
113        name: threads
114        type: u32
115        multi-attr: true
116      -
117        name: gracetime
118        type: u32
119      -
120        name: leasetime
121        type: u32
122      -
123        name: scope
124        type: string
125      -
126        name: min-threads
127        type: u32
128      -
129        name: fh-key
130        type: binary
131        checks:
132            exact-len: 16
133  -
134    name: version
135    attributes:
136      -
137        name: major
138        type: u32
139      -
140        name: minor
141        type: u32
142      -
143        name: enabled
144        type: flag
145  -
146    name: server-proto
147    attributes:
148      -
149        name: version
150        type: nest
151        nested-attributes: version
152        multi-attr: true
153  -
154    name: sock
155    attributes:
156      -
157        name: addr
158        type: binary
159      -
160        name: transport-name
161        type: string
162  -
163    name: server-sock
164    attributes:
165      -
166        name: addr
167        type: nest
168        nested-attributes: sock
169        multi-attr: true
170  -
171    name: pool-mode
172    attributes:
173      -
174        name: mode
175        type: string
176      -
177        name: npools
178        type: u32
179  -
180    name: fslocation
181    attributes:
182      -
183        name: host
184        type: string
185      -
186        name: path
187        type: string
188  -
189    name: fslocations
190    attributes:
191      -
192        name: location
193        type: nest
194        nested-attributes: fslocation
195        multi-attr: true
196  -
197    name: auth-flavor
198    attributes:
199      -
200        name: pseudoflavor
201        type: u32
202      -
203        name: flags
204        type: u32
205        enum: export-flags
206        enum-as-flags: true
207  -
208    name: svc-export
209    attributes:
210      -
211        name: seqno
212        type: u64
213      -
214        name: client
215        type: string
216      -
217        name: path
218        type: string
219      -
220        name: negative
221        type: flag
222      -
223        name: expiry
224        type: u64
225      -
226        name: anon-uid
227        type: u32
228      -
229        name: anon-gid
230        type: u32
231      -
232        name: fslocations
233        type: nest
234        nested-attributes: fslocations
235      -
236        name: uuid
237        type: binary
238      -
239        name: secinfo
240        type: nest
241        nested-attributes: auth-flavor
242        multi-attr: true
243      -
244        name: xprtsec
245        type: u32
246        enum: xprtsec-mode
247        multi-attr: true
248      -
249        name: flags
250        type: u32
251        enum: export-flags
252        enum-as-flags: true
253      -
254        name: fsid
255        type: s32
256  -
257    name: svc-export-reqs
258    attributes:
259      -
260        name: requests
261        type: nest
262        nested-attributes: svc-export
263        multi-attr: true
264  -
265    name: expkey
266    attributes:
267      -
268        name: seqno
269        type: u64
270      -
271        name: client
272        type: string
273      -
274        name: fsidtype
275        type: u8
276      -
277        name: fsid
278        type: binary
279      -
280        name: negative
281        type: flag
282      -
283        name: expiry
284        type: u64
285      -
286        name: path
287        type: string
288  -
289    name: expkey-reqs
290    attributes:
291      -
292        name: requests
293        type: nest
294        nested-attributes: expkey
295        multi-attr: true
296  -
297    name: cache-flush
298    attributes:
299      -
300        name: mask
301        type: u32
302        enum: cache-type
303        enum-as-flags: true
304  -
305    name: unlock-ip
306    attributes:
307      -
308        name: address
309        type: binary
310        doc: struct sockaddr_in or struct sockaddr_in6.
311        checks:
312          min-len: 16
313  -
314    name: unlock-filesystem
315    attributes:
316      -
317        name: path
318        type: string
319        doc: Filesystem path whose state should be released.
320  -
321    name: unlock-export
322    attributes:
323      -
324        name: path
325        type: string
326        doc: >-
327          Export path whose NFSv4 state should be revoked.
328          All state (opens, locks, delegations, layouts) acquired
329          through any export of this path is revoked, regardless
330          of which client holds the state. Intended for use after
331          all clients have been unexported from a given path,
332          enabling the underlying filesystem to be unmounted.
333
334operations:
335  list:
336    -
337      name: rpc-status-get
338      doc: dump pending nfsd rpc
339      attribute-set: rpc-status
340      dump:
341        reply:
342          attributes:
343            - xid
344            - flags
345            - prog
346            - version
347            - proc
348            - service-time
349            - saddr4
350            - daddr4
351            - saddr6
352            - daddr6
353            - sport
354            - dport
355            - compound-ops
356    -
357      name: threads-set
358      doc: set the maximum number of running threads
359      attribute-set: server
360      flags: [admin-perm]
361      do:
362        request:
363          attributes:
364            - threads
365            - gracetime
366            - leasetime
367            - scope
368            - min-threads
369            - fh-key
370    -
371      name: threads-get
372      doc: get the maximum number of running threads
373      attribute-set: server
374      do:
375        reply:
376          attributes:
377            - threads
378            - gracetime
379            - leasetime
380            - scope
381            - min-threads
382    -
383      name: version-set
384      doc: set nfs enabled versions
385      attribute-set: server-proto
386      flags: [admin-perm]
387      do:
388        request:
389          attributes:
390            - version
391    -
392      name: version-get
393      doc: get nfs enabled versions
394      attribute-set: server-proto
395      do:
396        reply:
397          attributes:
398            - version
399    -
400      name: listener-set
401      doc: set nfs running sockets
402      attribute-set: server-sock
403      flags: [admin-perm]
404      do:
405        request:
406          attributes:
407            - addr
408    -
409      name: listener-get
410      doc: get nfs running listeners
411      attribute-set: server-sock
412      do:
413        reply:
414          attributes:
415            - addr
416    -
417      name: pool-mode-set
418      doc: set the current server pool-mode
419      attribute-set: pool-mode
420      flags: [admin-perm]
421      do:
422        request:
423          attributes:
424            - mode
425    -
426      name: pool-mode-get
427      doc: get info about server pool-mode
428      attribute-set: pool-mode
429      do:
430        reply:
431          attributes:
432            - mode
433            - npools
434    -
435      name: cache-notify
436      doc: Notification that there are cache requests that need servicing
437      attribute-set: cache-notify
438      mcgrp: exportd
439      event:
440        attributes:
441          - cache-type
442    -
443      name: svc-export-get-reqs
444      doc: Dump all pending svc_export requests
445      attribute-set: svc-export-reqs
446      flags: [admin-perm]
447      dump:
448          reply:
449            attributes:
450              - requests
451    -
452      name: svc-export-set-reqs
453      doc: Respond to one or more svc_export requests
454      attribute-set: svc-export-reqs
455      flags: [admin-perm]
456      do:
457          request:
458            attributes:
459              - requests
460    -
461      name: expkey-get-reqs
462      doc: Dump all pending expkey requests
463      attribute-set: expkey-reqs
464      flags: [admin-perm]
465      dump:
466          reply:
467            attributes:
468              - requests
469    -
470      name: expkey-set-reqs
471      doc: Respond to one or more expkey requests
472      attribute-set: expkey-reqs
473      flags: [admin-perm]
474      do:
475          request:
476            attributes:
477              - requests
478    -
479      name: cache-flush
480      doc: Flush nfsd caches (svc_export and/or expkey)
481      attribute-set: cache-flush
482      flags: [admin-perm]
483      do:
484        request:
485          attributes:
486            - mask
487    -
488      name: unlock-ip
489      doc: release NLM locks held by an IP address
490      attribute-set: unlock-ip
491      flags: [admin-perm]
492      do:
493        request:
494          attributes:
495            - address
496    -
497      name: unlock-filesystem
498      doc: revoke NFS state under a filesystem path
499      attribute-set: unlock-filesystem
500      flags: [admin-perm]
501      do:
502        request:
503          attributes:
504            - path
505    -
506      name: unlock-export
507      doc: >-
508        Revoke NFSv4 state acquired through exports of a given path.
509        Unlike unlock-filesystem, which operates at superblock granularity,
510        this command targets only state associated with a specific export
511        path. Userspace (exportfs -u) sends this after removing the last
512        client for a path so the underlying filesystem can be unmounted.
513      attribute-set: unlock-export
514      flags: [admin-perm]
515      do:
516        request:
517          attributes:
518            - path
519
520mcast-groups:
521  list:
522    -
523      name: none
524    -
525      name: exportd
526