Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
f14122b2
Commit
f14122b2
authored
Oct 05, 2023
by
Chuck Lever
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tools: ynl: Add source files for nfsd netlink protocol
Signed-off-by:
Chuck Lever
<
chuck.lever@oracle.com
>
parent
bd9d6a3e
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
130 additions
and
1 deletion
+130
-1
tools/net/ynl/Makefile.deps
tools/net/ynl/Makefile.deps
+1
-0
tools/net/ynl/generated/Makefile
tools/net/ynl/generated/Makefile
+1
-1
tools/net/ynl/generated/nfsd-user.c
tools/net/ynl/generated/nfsd-user.c
+95
-0
tools/net/ynl/generated/nfsd-user.h
tools/net/ynl/generated/nfsd-user.h
+33
-0
No files found.
tools/net/ynl/Makefile.deps
View file @
f14122b2
...
...
@@ -18,3 +18,4 @@ CFLAGS_devlink:=$(call get_hdr_inc,_LINUX_DEVLINK_H_,devlink.h)
CFLAGS_ethtool
:=
$(
call
get_hdr_inc,_LINUX_ETHTOOL_NETLINK_H_,ethtool_netlink.h
)
CFLAGS_handshake
:=
$(
call
get_hdr_inc,_LINUX_HANDSHAKE_H,handshake.h
)
CFLAGS_netdev
:=
$(
call
get_hdr_inc,_LINUX_NETDEV_H,netdev.h
)
CFLAGS_nfsd
:=
$(
call
get_hdr_inc,_LINUX_NFSD_H,nfsd.h
)
tools/net/ynl/generated/Makefile
View file @
f14122b2
...
...
@@ -14,7 +14,7 @@ YNL_GEN_ARG_ethtool:=--user-header linux/ethtool_netlink.h \
TOOL
:=
../ynl-gen-c.py
GENS
:=
ethtool devlink handshake fou netdev
GENS
:=
ethtool devlink handshake fou netdev
nfsd
SRCS
=
$(
patsubst
%,%-user.c,
${GENS}
)
HDRS
=
$(
patsubst
%,%-user.h,
${GENS}
)
OBJS
=
$(
patsubst
%,%-user.o,
${GENS}
)
...
...
tools/net/ynl/generated/nfsd-user.c
0 → 100644
View file @
f14122b2
// SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)
/* Do not edit directly, auto-generated from: */
/* Documentation/netlink/specs/nfsd.yaml */
/* YNL-GEN user source */
#include <stdlib.h>
#include <string.h>
#include "nfsd-user.h"
#include "ynl.h"
#include <linux/nfsd_netlink.h>
#include <libmnl/libmnl.h>
#include <linux/genetlink.h>
/* Enums */
static
const
char
*
const
nfsd_op_strmap
[]
=
{
[
NFSD_CMD_RPC_STATUS_GET
]
=
"rpc-status-get"
,
};
const
char
*
nfsd_op_str
(
int
op
)
{
if
(
op
<
0
||
op
>=
(
int
)
MNL_ARRAY_SIZE
(
nfsd_op_strmap
))
return
NULL
;
return
nfsd_op_strmap
[
op
];
}
/* Policies */
struct
ynl_policy_attr
nfsd_rpc_status_policy
[
NFSD_A_RPC_STATUS_MAX
+
1
]
=
{
[
NFSD_A_RPC_STATUS_XID
]
=
{
.
name
=
"xid"
,
.
type
=
YNL_PT_U32
,
},
[
NFSD_A_RPC_STATUS_FLAGS
]
=
{
.
name
=
"flags"
,
.
type
=
YNL_PT_U32
,
},
[
NFSD_A_RPC_STATUS_PROG
]
=
{
.
name
=
"prog"
,
.
type
=
YNL_PT_U32
,
},
[
NFSD_A_RPC_STATUS_VERSION
]
=
{
.
name
=
"version"
,
.
type
=
YNL_PT_U8
,
},
[
NFSD_A_RPC_STATUS_PROC
]
=
{
.
name
=
"proc"
,
.
type
=
YNL_PT_U32
,
},
[
NFSD_A_RPC_STATUS_SERVICE_TIME
]
=
{
.
name
=
"service_time"
,
.
type
=
YNL_PT_U64
,
},
[
NFSD_A_RPC_STATUS_PAD
]
=
{
.
name
=
"pad"
,
.
type
=
YNL_PT_IGNORE
,
},
[
NFSD_A_RPC_STATUS_SADDR4
]
=
{
.
name
=
"saddr4"
,
.
type
=
YNL_PT_U32
,
},
[
NFSD_A_RPC_STATUS_DADDR4
]
=
{
.
name
=
"daddr4"
,
.
type
=
YNL_PT_U32
,
},
[
NFSD_A_RPC_STATUS_SADDR6
]
=
{
.
name
=
"saddr6"
,
.
type
=
YNL_PT_BINARY
,},
[
NFSD_A_RPC_STATUS_DADDR6
]
=
{
.
name
=
"daddr6"
,
.
type
=
YNL_PT_BINARY
,},
[
NFSD_A_RPC_STATUS_SPORT
]
=
{
.
name
=
"sport"
,
.
type
=
YNL_PT_U16
,
},
[
NFSD_A_RPC_STATUS_DPORT
]
=
{
.
name
=
"dport"
,
.
type
=
YNL_PT_U16
,
},
[
NFSD_A_RPC_STATUS_COMPOUND_OPS
]
=
{
.
name
=
"compound-ops"
,
.
type
=
YNL_PT_U32
,
},
};
struct
ynl_policy_nest
nfsd_rpc_status_nest
=
{
.
max_attr
=
NFSD_A_RPC_STATUS_MAX
,
.
table
=
nfsd_rpc_status_policy
,
};
/* Common nested types */
/* ============== NFSD_CMD_RPC_STATUS_GET ============== */
/* NFSD_CMD_RPC_STATUS_GET - dump */
void
nfsd_rpc_status_get_list_free
(
struct
nfsd_rpc_status_get_list
*
rsp
)
{
struct
nfsd_rpc_status_get_list
*
next
=
rsp
;
while
((
void
*
)
next
!=
YNL_LIST_END
)
{
rsp
=
next
;
next
=
rsp
->
next
;
free
(
rsp
->
obj
.
saddr6
);
free
(
rsp
->
obj
.
daddr6
);
free
(
rsp
->
obj
.
compound_ops
);
free
(
rsp
);
}
}
struct
nfsd_rpc_status_get_list
*
nfsd_rpc_status_get_dump
(
struct
ynl_sock
*
ys
)
{
struct
ynl_dump_state
yds
=
{};
struct
nlmsghdr
*
nlh
;
int
err
;
yds
.
ys
=
ys
;
yds
.
alloc_sz
=
sizeof
(
struct
nfsd_rpc_status_get_list
);
yds
.
cb
=
nfsd_rpc_status_get_rsp_parse
;
yds
.
rsp_cmd
=
NFSD_CMD_RPC_STATUS_GET
;
yds
.
rsp_policy
=
&
nfsd_rpc_status_nest
;
nlh
=
ynl_gemsg_start_dump
(
ys
,
ys
->
family_id
,
NFSD_CMD_RPC_STATUS_GET
,
1
);
err
=
ynl_exec_dump
(
ys
,
nlh
,
&
yds
);
if
(
err
<
0
)
goto
free_list
;
return
yds
.
first
;
free_list:
nfsd_rpc_status_get_list_free
(
yds
.
first
);
return
NULL
;
}
const
struct
ynl_family
ynl_nfsd_family
=
{
.
name
=
"nfsd"
,
};
tools/net/ynl/generated/nfsd-user.h
0 → 100644
View file @
f14122b2
/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) */
/* Do not edit directly, auto-generated from: */
/* Documentation/netlink/specs/nfsd.yaml */
/* YNL-GEN user header */
#ifndef _LINUX_NFSD_GEN_H
#define _LINUX_NFSD_GEN_H
#include <stdlib.h>
#include <string.h>
#include <linux/types.h>
#include <linux/nfsd_netlink.h>
struct
ynl_sock
;
extern
const
struct
ynl_family
ynl_nfsd_family
;
/* Enums */
const
char
*
nfsd_op_str
(
int
op
);
/* Common nested types */
/* ============== NFSD_CMD_RPC_STATUS_GET ============== */
/* NFSD_CMD_RPC_STATUS_GET - dump */
struct
nfsd_rpc_status_get_list
{
struct
nfsd_rpc_status_get_list
*
next
;
struct
nfsd_rpc_status_get_rsp
obj
__attribute__
((
aligned
(
8
)));
};
void
nfsd_rpc_status_get_list_free
(
struct
nfsd_rpc_status_get_list
*
rsp
);
struct
nfsd_rpc_status_get_list
*
nfsd_rpc_status_get_dump
(
struct
ynl_sock
*
ys
);
#endif
/* _LINUX_NFSD_GEN_H */
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment