Generate stubs and uAPI for nfsd netlink protocol. For the moment, the new protocol has one operation: rpc_status. The generated header and source files are created by running: tools/net/ynl/ynl-regen.sh
Unified · Split
| @@ -0,0 +1,89 @@ | |||
| 1 | # SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) | ||
| 2 | |||
| 3 | name: nfsd | ||
| 4 | protocol: genetlink | ||
| 5 | uapi-header: linux/nfsd_netlink.h | ||
| 6 | |||
| 7 | doc: NFSD configuration over generic netlink. | ||
| 8 | |||
| 9 | attribute-sets: | ||
| 10 | - | ||
| 11 | name: rpc-status | ||
| 12 | attributes: | ||
| 13 | - | ||
| 14 | name: xid | ||
| 15 | type: u32 | ||
| 16 | byte-order: big-endian | ||
| 17 | - | ||
| 18 | name: flags | ||
| 19 | type: u32 | ||
| 20 | - | ||
| 21 | name: prog | ||
| 22 | type: u32 | ||
| 23 | - | ||
| 24 | name: version | ||
| 25 | type: u8 | ||
| 26 | - | ||
| 27 | name: proc | ||
| 28 | type: u32 | ||
| 29 | - | ||
| 30 | name: service_time | ||
| 31 | type: s64 | ||
| 32 | - | ||
| 33 | name: pad | ||
| 34 | type: pad | ||
| 35 | - | ||
| 36 | name: saddr4 | ||
| 37 | type: u32 | ||
| 38 | byte-order: big-endian | ||
| 39 | display-hint: ipv4 | ||
| 40 | - | ||
| 41 | name: daddr4 | ||
| 42 | type: u32 | ||
| 43 | byte-order: big-endian | ||
| 44 | display-hint: ipv4 | ||
| 45 | - | ||
| 46 | name: saddr6 | ||
| 47 | type: binary | ||
| 48 | display-hint: ipv6 | ||
| 49 | - | ||
| 50 | name: daddr6 | ||
| 51 | type: binary | ||
| 52 | display-hint: ipv6 | ||
| 53 | - | ||
| 54 | name: sport | ||
| 55 | type: u16 | ||
| 56 | byte-order: big-endian | ||
| 57 | - | ||
| 58 | name: dport | ||
| 59 | type: u16 | ||
| 60 | byte-order: big-endian | ||
| 61 | - | ||
| 62 | name: compound-ops | ||
| 63 | type: u32 | ||
| 64 | multi-attr: true | ||
| 65 | |||
| 66 | operations: | ||
| 67 | list: | ||
| 68 | - | ||
| 69 | name: rpc-status-get | ||
| 70 | doc: dump pending nfsd rpc | ||
| 71 | attribute-set: rpc-status | ||
| 72 | dump: | ||
| 73 | pre: nfsd-nl-rpc-status-get-start | ||
| 74 | post: nfsd-nl-rpc-status-get-done | ||
| 75 | reply: | ||
| 76 | attributes: | ||
| 77 | - xid | ||
| 78 | - flags | ||
| 79 | - prog | ||
| 80 | - version | ||
| 81 | - proc | ||
| 82 | - service_time | ||
| 83 | - saddr4 | ||
| 84 | - daddr4 | ||
| 85 | - saddr6 | ||
| 86 | - daddr6 | ||
| 87 | - sport | ||
| 88 | - dport | ||
| 89 | - compound-ops | ||
| @@ -12,7 +12,8 @@ nfsd-y += trace.o · 11 unmodified lines | |||
| 12 | 12 | ||
| 13 | nfsd-y += nfssvc.o nfsctl.o nfsfh.o vfs.o \ | 13 | nfsd-y += nfssvc.o nfsctl.o nfsfh.o vfs.o \ |
| 14 | export.o auth.o lockd.o nfscache.o \ | 14 | export.o auth.o lockd.o nfscache.o \ |
| 15 | stats.o filecache.o nfs3proc.o nfs3xdr.o | 15 | stats.o filecache.o nfs3proc.o nfs3xdr.o \ |
| 16 | netlink.o | ||
| 16 | nfsd-$(CONFIG_NFSD_V2) += nfsproc.o nfsxdr.o | 17 | nfsd-$(CONFIG_NFSD_V2) += nfsproc.o nfsxdr.o |
| 17 | nfsd-$(CONFIG_NFSD_V2_ACL) += nfs2acl.o | 18 | nfsd-$(CONFIG_NFSD_V2_ACL) += nfs2acl.o |
| 18 | nfsd-$(CONFIG_NFSD_V3_ACL) += nfs3acl.o | 19 | nfsd-$(CONFIG_NFSD_V3_ACL) += nfs3acl.o |
| @@ -0,0 +1,32 @@ | |||
| 1 | // SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) | ||
| 2 | /* Do not edit directly, auto-generated from: */ | ||
| 3 | /* Documentation/netlink/specs/nfsd.yaml */ | ||
| 4 | /* YNL-GEN kernel source */ | ||
| 5 | |||
| 6 | #include <net/netlink.h> | ||
| 7 | #include <net/genetlink.h> | ||
| 8 | |||
| 9 | #include "netlink.h" | ||
| 10 | |||
| 11 | #include <uapi/linux/nfsd_netlink.h> | ||
| 12 | |||
| 13 | /* Ops table for nfsd */ | ||
| 14 | static const struct genl_split_ops nfsd_nl_ops[] = { | ||
| 15 | { | ||
| 16 | .cmd = NFSD_CMD_RPC_STATUS_GET, | ||
| 17 | .start = nfsd_nl_rpc_status_get_start, | ||
| 18 | .dumpit = nfsd_nl_rpc_status_get_dumpit, | ||
| 19 | .done = nfsd_nl_rpc_status_get_done, | ||
| 20 | .flags = GENL_CMD_CAP_DUMP, | ||
| 21 | }, | ||
| 22 | }; | ||
| 23 | |||
| 24 | struct genl_family nfsd_nl_family __ro_after_init = { | ||
| 25 | .name = NFSD_FAMILY_NAME, | ||
| 26 | .version = NFSD_FAMILY_VERSION, | ||
| 27 | .netnsok = true, | ||
| 28 | .parallel_ops = true, | ||
| 29 | .module = THIS_MODULE, | ||
| 30 | .split_ops = nfsd_nl_ops, | ||
| 31 | .n_split_ops = ARRAY_SIZE(nfsd_nl_ops), | ||
| 32 | }; | ||
| @@ -0,0 +1,22 @@ | |||
| 1 | /* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) */ | ||
| 2 | /* Do not edit directly, auto-generated from: */ | ||
| 3 | /* Documentation/netlink/specs/nfsd.yaml */ | ||
| 4 | /* YNL-GEN kernel header */ | ||
| 5 | |||
| 6 | #ifndef _LINUX_NFSD_GEN_H | ||
| 7 | #define _LINUX_NFSD_GEN_H | ||
| 8 | |||
| 9 | #include <net/netlink.h> | ||
| 10 | #include <net/genetlink.h> | ||
| 11 | |||
| 12 | #include <uapi/linux/nfsd_netlink.h> | ||
| 13 | |||
| 14 | int nfsd_nl_rpc_status_get_start(struct netlink_callback *cb); | ||
| 15 | int nfsd_nl_rpc_status_get_done(struct netlink_callback *cb); | ||
| 16 | |||
| 17 | int nfsd_nl_rpc_status_get_dumpit(struct sk_buff *skb, | ||
| 18 | struct netlink_callback *cb); | ||
| 19 | |||
| 20 | extern struct genl_family nfsd_nl_family; | ||
| 21 | |||
| 22 | #endif /* _LINUX_NFSD_GEN_H */ | ||
| @@ -26,6 +26,7 @@ · 25 unmodified lines | |||
| 26 | #include "pnfs.h" | 26 | #include "pnfs.h" |
| 27 | #include "filecache.h" | 27 | #include "filecache.h" |
| 28 | #include "trace.h" | 28 | #include "trace.h" |
| 29 | #include "netlink.h" | ||
| 29 | 30 | ||
| 30 | /* | 31 | /* |
| 31 | * We have a single directory with several nodes in it. | 32 | * We have a single directory with several nodes in it. |
| @@ -1495,6 +1496,22 @@ static int create_proc_exports_entry(void) · 1463 unmodified lines | |||
| 1495 | 1496 | ||
| 1496 | unsigned int nfsd_net_id; | 1497 | unsigned int nfsd_net_id; |
| 1497 | 1498 | ||
| 1499 | int nfsd_nl_rpc_status_get_start(struct netlink_callback *cb) | ||
| 1500 | { | ||
| 1501 | return 0; | ||
| 1502 | } | ||
| 1503 | |||
| 1504 | int nfsd_nl_rpc_status_get_dumpit(struct sk_buff *skb, | ||
| 1505 | struct netlink_callback *cb) | ||
| 1506 | { | ||
| 1507 | return 0; | ||
| 1508 | } | ||
| 1509 | |||
| 1510 | int nfsd_nl_rpc_status_get_done(struct netlink_callback *cb) | ||
| 1511 | { | ||
| 1512 | return 0; | ||
| 1513 | } | ||
| 1514 | |||
| 1498 | /** | 1515 | /** |
| 1499 | * nfsd_net_init - Prepare the nfsd_net portion of a new net namespace | 1516 | * nfsd_net_init - Prepare the nfsd_net portion of a new net namespace |
| 1500 | * @net: a freshly-created network namespace | 1517 | * @net: a freshly-created network namespace |
| @@ -0,0 +1,39 @@ | |||
| 1 | /* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) */ | ||
| 2 | /* Do not edit directly, auto-generated from: */ | ||
| 3 | /* Documentation/netlink/specs/nfsd.yaml */ | ||
| 4 | /* YNL-GEN uapi header */ | ||
| 5 | |||
| 6 | #ifndef _UAPI_LINUX_NFSD_H | ||
| 7 | #define _UAPI_LINUX_NFSD_H | ||
| 8 | |||
| 9 | #define NFSD_FAMILY_NAME "nfsd" | ||
| 10 | #define NFSD_FAMILY_VERSION 1 | ||
| 11 | |||
| 12 | enum { | ||
| 13 | NFSD_A_RPC_STATUS_XID = 1, | ||
| 14 | NFSD_A_RPC_STATUS_FLAGS, | ||
| 15 | NFSD_A_RPC_STATUS_PROG, | ||
| 16 | NFSD_A_RPC_STATUS_VERSION, | ||
| 17 | NFSD_A_RPC_STATUS_PROC, | ||
| 18 | NFSD_A_RPC_STATUS_SERVICE_TIME, | ||
| 19 | NFSD_A_RPC_STATUS_PAD, | ||
| 20 | NFSD_A_RPC_STATUS_SADDR4, | ||
| 21 | NFSD_A_RPC_STATUS_DADDR4, | ||
| 22 | NFSD_A_RPC_STATUS_SADDR6, | ||
| 23 | NFSD_A_RPC_STATUS_DADDR6, | ||
| 24 | NFSD_A_RPC_STATUS_SPORT, | ||
| 25 | NFSD_A_RPC_STATUS_DPORT, | ||
| 26 | NFSD_A_RPC_STATUS_COMPOUND_OPS, | ||
| 27 | |||
| 28 | __NFSD_A_RPC_STATUS_MAX, | ||
| 29 | NFSD_A_RPC_STATUS_MAX = (__NFSD_A_RPC_STATUS_MAX - 1) | ||
| 30 | }; | ||
| 31 | |||
| 32 | enum { | ||
| 33 | NFSD_CMD_RPC_STATUS_GET = 1, | ||
| 34 | |||
| 35 | __NFSD_CMD_MAX, | ||
| 36 | NFSD_CMD_MAX = (__NFSD_CMD_MAX - 1) | ||
| 37 | }; | ||
| 38 | |||
| 39 | #endif /* _UAPI_LINUX_NFSD_H */ | ||