Commit f7c0e362 authored by Jakub Kicinski's avatar Jakub Kicinski

tools: ynl: remove generated user space code from git

The ynl-generated user space C code is already above 25kLoC
and is growing.

The initial reason to commit these files was to make reviewing changes
to the generator easier. Unfortunately, it has the opposite effect on
reviewing changes to specs, and we get far more changes to specs
than to the generator.

Uncommit those fails, as they are generated on the fly as needed.
netdev patchwork now runs a script on each series to create a diff
of generated code on the fly, for the rare cases when looking at
it is helpful:
https://github.com/kuba-moo/nipa/blob/master/tests/series/ynl/ynl.shSuggested-by: default avatarPaolo Abeni <pabeni@redhat.com>
Acked-by: default avatarChuck Lever <chuck.lever@oracle.com>
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 5ab500d6
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
// SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)
/* Do not edit directly, auto-generated from: */
/* Documentation/netlink/specs/fou.yaml */
/* YNL-GEN user source */
#include <stdlib.h>
#include <string.h>
#include "fou-user.h"
#include "ynl.h"
#include <linux/fou.h>
#include <libmnl/libmnl.h>
#include <linux/genetlink.h>
/* Enums */
static const char * const fou_op_strmap[] = {
[FOU_CMD_ADD] = "add",
[FOU_CMD_DEL] = "del",
[FOU_CMD_GET] = "get",
};
const char *fou_op_str(int op)
{
if (op < 0 || op >= (int)MNL_ARRAY_SIZE(fou_op_strmap))
return NULL;
return fou_op_strmap[op];
}
static const char * const fou_encap_type_strmap[] = {
[0] = "unspec",
[1] = "direct",
[2] = "gue",
};
const char *fou_encap_type_str(int value)
{
if (value < 0 || value >= (int)MNL_ARRAY_SIZE(fou_encap_type_strmap))
return NULL;
return fou_encap_type_strmap[value];
}
/* Policies */
struct ynl_policy_attr fou_policy[FOU_ATTR_MAX + 1] = {
[FOU_ATTR_UNSPEC] = { .name = "unspec", .type = YNL_PT_REJECT, },
[FOU_ATTR_PORT] = { .name = "port", .type = YNL_PT_U16, },
[FOU_ATTR_AF] = { .name = "af", .type = YNL_PT_U8, },
[FOU_ATTR_IPPROTO] = { .name = "ipproto", .type = YNL_PT_U8, },
[FOU_ATTR_TYPE] = { .name = "type", .type = YNL_PT_U8, },
[FOU_ATTR_REMCSUM_NOPARTIAL] = { .name = "remcsum_nopartial", .type = YNL_PT_FLAG, },
[FOU_ATTR_LOCAL_V4] = { .name = "local_v4", .type = YNL_PT_U32, },
[FOU_ATTR_LOCAL_V6] = { .name = "local_v6", .type = YNL_PT_BINARY,},
[FOU_ATTR_PEER_V4] = { .name = "peer_v4", .type = YNL_PT_U32, },
[FOU_ATTR_PEER_V6] = { .name = "peer_v6", .type = YNL_PT_BINARY,},
[FOU_ATTR_PEER_PORT] = { .name = "peer_port", .type = YNL_PT_U16, },
[FOU_ATTR_IFINDEX] = { .name = "ifindex", .type = YNL_PT_U32, },
};
struct ynl_policy_nest fou_nest = {
.max_attr = FOU_ATTR_MAX,
.table = fou_policy,
};
/* Common nested types */
/* ============== FOU_CMD_ADD ============== */
/* FOU_CMD_ADD - do */
void fou_add_req_free(struct fou_add_req *req)
{
free(req->local_v6);
free(req->peer_v6);
free(req);
}
int fou_add(struct ynl_sock *ys, struct fou_add_req *req)
{
struct ynl_req_state yrs = { .yarg = { .ys = ys, }, };
struct nlmsghdr *nlh;
int err;
nlh = ynl_gemsg_start_req(ys, ys->family_id, FOU_CMD_ADD, 1);
ys->req_policy = &fou_nest;
if (req->_present.port)
mnl_attr_put_u16(nlh, FOU_ATTR_PORT, req->port);
if (req->_present.ipproto)
mnl_attr_put_u8(nlh, FOU_ATTR_IPPROTO, req->ipproto);
if (req->_present.type)
mnl_attr_put_u8(nlh, FOU_ATTR_TYPE, req->type);
if (req->_present.remcsum_nopartial)
mnl_attr_put(nlh, FOU_ATTR_REMCSUM_NOPARTIAL, 0, NULL);
if (req->_present.local_v4)
mnl_attr_put_u32(nlh, FOU_ATTR_LOCAL_V4, req->local_v4);
if (req->_present.peer_v4)
mnl_attr_put_u32(nlh, FOU_ATTR_PEER_V4, req->peer_v4);
if (req->_present.local_v6_len)
mnl_attr_put(nlh, FOU_ATTR_LOCAL_V6, req->_present.local_v6_len, req->local_v6);
if (req->_present.peer_v6_len)
mnl_attr_put(nlh, FOU_ATTR_PEER_V6, req->_present.peer_v6_len, req->peer_v6);
if (req->_present.peer_port)
mnl_attr_put_u16(nlh, FOU_ATTR_PEER_PORT, req->peer_port);
if (req->_present.ifindex)
mnl_attr_put_u32(nlh, FOU_ATTR_IFINDEX, req->ifindex);
err = ynl_exec(ys, nlh, &yrs);
if (err < 0)
return -1;
return 0;
}
/* ============== FOU_CMD_DEL ============== */
/* FOU_CMD_DEL - do */
void fou_del_req_free(struct fou_del_req *req)
{
free(req->local_v6);
free(req->peer_v6);
free(req);
}
int fou_del(struct ynl_sock *ys, struct fou_del_req *req)
{
struct ynl_req_state yrs = { .yarg = { .ys = ys, }, };
struct nlmsghdr *nlh;
int err;
nlh = ynl_gemsg_start_req(ys, ys->family_id, FOU_CMD_DEL, 1);
ys->req_policy = &fou_nest;
if (req->_present.af)
mnl_attr_put_u8(nlh, FOU_ATTR_AF, req->af);
if (req->_present.ifindex)
mnl_attr_put_u32(nlh, FOU_ATTR_IFINDEX, req->ifindex);
if (req->_present.port)
mnl_attr_put_u16(nlh, FOU_ATTR_PORT, req->port);
if (req->_present.peer_port)
mnl_attr_put_u16(nlh, FOU_ATTR_PEER_PORT, req->peer_port);
if (req->_present.local_v4)
mnl_attr_put_u32(nlh, FOU_ATTR_LOCAL_V4, req->local_v4);
if (req->_present.peer_v4)
mnl_attr_put_u32(nlh, FOU_ATTR_PEER_V4, req->peer_v4);
if (req->_present.local_v6_len)
mnl_attr_put(nlh, FOU_ATTR_LOCAL_V6, req->_present.local_v6_len, req->local_v6);
if (req->_present.peer_v6_len)
mnl_attr_put(nlh, FOU_ATTR_PEER_V6, req->_present.peer_v6_len, req->peer_v6);
err = ynl_exec(ys, nlh, &yrs);
if (err < 0)
return -1;
return 0;
}
/* ============== FOU_CMD_GET ============== */
/* FOU_CMD_GET - do */
void fou_get_req_free(struct fou_get_req *req)
{
free(req->local_v6);
free(req->peer_v6);
free(req);
}
void fou_get_rsp_free(struct fou_get_rsp *rsp)
{
free(rsp->local_v6);
free(rsp->peer_v6);
free(rsp);
}
int fou_get_rsp_parse(const struct nlmsghdr *nlh, void *data)
{
struct ynl_parse_arg *yarg = data;
const struct nlattr *attr;
struct fou_get_rsp *dst;
dst = yarg->data;
mnl_attr_for_each(attr, nlh, sizeof(struct genlmsghdr)) {
unsigned int type = mnl_attr_get_type(attr);
if (type == FOU_ATTR_PORT) {
if (ynl_attr_validate(yarg, attr))
return MNL_CB_ERROR;
dst->_present.port = 1;
dst->port = mnl_attr_get_u16(attr);
} else if (type == FOU_ATTR_IPPROTO) {
if (ynl_attr_validate(yarg, attr))
return MNL_CB_ERROR;
dst->_present.ipproto = 1;
dst->ipproto = mnl_attr_get_u8(attr);
} else if (type == FOU_ATTR_TYPE) {
if (ynl_attr_validate(yarg, attr))
return MNL_CB_ERROR;
dst->_present.type = 1;
dst->type = mnl_attr_get_u8(attr);
} else if (type == FOU_ATTR_REMCSUM_NOPARTIAL) {
if (ynl_attr_validate(yarg, attr))
return MNL_CB_ERROR;
dst->_present.remcsum_nopartial = 1;
} else if (type == FOU_ATTR_LOCAL_V4) {
if (ynl_attr_validate(yarg, attr))
return MNL_CB_ERROR;
dst->_present.local_v4 = 1;
dst->local_v4 = mnl_attr_get_u32(attr);
} else if (type == FOU_ATTR_PEER_V4) {
if (ynl_attr_validate(yarg, attr))
return MNL_CB_ERROR;
dst->_present.peer_v4 = 1;
dst->peer_v4 = mnl_attr_get_u32(attr);
} else if (type == FOU_ATTR_LOCAL_V6) {
unsigned int len;
if (ynl_attr_validate(yarg, attr))
return MNL_CB_ERROR;
len = mnl_attr_get_payload_len(attr);
dst->_present.local_v6_len = len;
dst->local_v6 = malloc(len);
memcpy(dst->local_v6, mnl_attr_get_payload(attr), len);
} else if (type == FOU_ATTR_PEER_V6) {
unsigned int len;
if (ynl_attr_validate(yarg, attr))
return MNL_CB_ERROR;
len = mnl_attr_get_payload_len(attr);
dst->_present.peer_v6_len = len;
dst->peer_v6 = malloc(len);
memcpy(dst->peer_v6, mnl_attr_get_payload(attr), len);
} else if (type == FOU_ATTR_PEER_PORT) {
if (ynl_attr_validate(yarg, attr))
return MNL_CB_ERROR;
dst->_present.peer_port = 1;
dst->peer_port = mnl_attr_get_u16(attr);
} else if (type == FOU_ATTR_IFINDEX) {
if (ynl_attr_validate(yarg, attr))
return MNL_CB_ERROR;
dst->_present.ifindex = 1;
dst->ifindex = mnl_attr_get_u32(attr);
}
}
return MNL_CB_OK;
}
struct fou_get_rsp *fou_get(struct ynl_sock *ys, struct fou_get_req *req)
{
struct ynl_req_state yrs = { .yarg = { .ys = ys, }, };
struct fou_get_rsp *rsp;
struct nlmsghdr *nlh;
int err;
nlh = ynl_gemsg_start_req(ys, ys->family_id, FOU_CMD_GET, 1);
ys->req_policy = &fou_nest;
yrs.yarg.rsp_policy = &fou_nest;
if (req->_present.af)
mnl_attr_put_u8(nlh, FOU_ATTR_AF, req->af);
if (req->_present.ifindex)
mnl_attr_put_u32(nlh, FOU_ATTR_IFINDEX, req->ifindex);
if (req->_present.port)
mnl_attr_put_u16(nlh, FOU_ATTR_PORT, req->port);
if (req->_present.peer_port)
mnl_attr_put_u16(nlh, FOU_ATTR_PEER_PORT, req->peer_port);
if (req->_present.local_v4)
mnl_attr_put_u32(nlh, FOU_ATTR_LOCAL_V4, req->local_v4);
if (req->_present.peer_v4)
mnl_attr_put_u32(nlh, FOU_ATTR_PEER_V4, req->peer_v4);
if (req->_present.local_v6_len)
mnl_attr_put(nlh, FOU_ATTR_LOCAL_V6, req->_present.local_v6_len, req->local_v6);
if (req->_present.peer_v6_len)
mnl_attr_put(nlh, FOU_ATTR_PEER_V6, req->_present.peer_v6_len, req->peer_v6);
rsp = calloc(1, sizeof(*rsp));
yrs.yarg.data = rsp;
yrs.cb = fou_get_rsp_parse;
yrs.rsp_cmd = FOU_CMD_GET;
err = ynl_exec(ys, nlh, &yrs);
if (err < 0)
goto err_free;
return rsp;
err_free:
fou_get_rsp_free(rsp);
return NULL;
}
/* FOU_CMD_GET - dump */
void fou_get_list_free(struct fou_get_list *rsp)
{
struct fou_get_list *next = rsp;
while ((void *)next != YNL_LIST_END) {
rsp = next;
next = rsp->next;
free(rsp->obj.local_v6);
free(rsp->obj.peer_v6);
free(rsp);
}
}
struct fou_get_list *fou_get_dump(struct ynl_sock *ys)
{
struct ynl_dump_state yds = {};
struct nlmsghdr *nlh;
int err;
yds.ys = ys;
yds.alloc_sz = sizeof(struct fou_get_list);
yds.cb = fou_get_rsp_parse;
yds.rsp_cmd = FOU_CMD_GET;
yds.rsp_policy = &fou_nest;
nlh = ynl_gemsg_start_dump(ys, ys->family_id, FOU_CMD_GET, 1);
err = ynl_exec_dump(ys, nlh, &yds);
if (err < 0)
goto free_list;
return yds.first;
free_list:
fou_get_list_free(yds.first);
return NULL;
}
const struct ynl_family ynl_fou_family = {
.name = "fou",
};
/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) */
/* Do not edit directly, auto-generated from: */
/* Documentation/netlink/specs/fou.yaml */
/* YNL-GEN user header */
#ifndef _LINUX_FOU_GEN_H
#define _LINUX_FOU_GEN_H
#include <stdlib.h>
#include <string.h>
#include <linux/types.h>
#include <linux/fou.h>
struct ynl_sock;
extern const struct ynl_family ynl_fou_family;
/* Enums */
const char *fou_op_str(int op);
const char *fou_encap_type_str(int value);
/* Common nested types */
/* ============== FOU_CMD_ADD ============== */
/* FOU_CMD_ADD - do */
struct fou_add_req {
struct {
__u32 port:1;
__u32 ipproto:1;
__u32 type:1;
__u32 remcsum_nopartial:1;
__u32 local_v4:1;
__u32 peer_v4:1;
__u32 local_v6_len;
__u32 peer_v6_len;
__u32 peer_port:1;
__u32 ifindex:1;
} _present;
__u16 port /* big-endian */;
__u8 ipproto;
__u8 type;
__u32 local_v4;
__u32 peer_v4;
void *local_v6;
void *peer_v6;
__u16 peer_port /* big-endian */;
__s32 ifindex;
};
static inline struct fou_add_req *fou_add_req_alloc(void)
{
return calloc(1, sizeof(struct fou_add_req));
}
void fou_add_req_free(struct fou_add_req *req);
static inline void
fou_add_req_set_port(struct fou_add_req *req, __u16 port /* big-endian */)
{
req->_present.port = 1;
req->port = port;
}
static inline void
fou_add_req_set_ipproto(struct fou_add_req *req, __u8 ipproto)
{
req->_present.ipproto = 1;
req->ipproto = ipproto;
}
static inline void fou_add_req_set_type(struct fou_add_req *req, __u8 type)
{
req->_present.type = 1;
req->type = type;
}
static inline void fou_add_req_set_remcsum_nopartial(struct fou_add_req *req)
{
req->_present.remcsum_nopartial = 1;
}
static inline void
fou_add_req_set_local_v4(struct fou_add_req *req, __u32 local_v4)
{
req->_present.local_v4 = 1;
req->local_v4 = local_v4;
}
static inline void
fou_add_req_set_peer_v4(struct fou_add_req *req, __u32 peer_v4)
{
req->_present.peer_v4 = 1;
req->peer_v4 = peer_v4;
}
static inline void
fou_add_req_set_local_v6(struct fou_add_req *req, const void *local_v6,
size_t len)
{
free(req->local_v6);
req->_present.local_v6_len = len;
req->local_v6 = malloc(req->_present.local_v6_len);
memcpy(req->local_v6, local_v6, req->_present.local_v6_len);
}
static inline void
fou_add_req_set_peer_v6(struct fou_add_req *req, const void *peer_v6,
size_t len)
{
free(req->peer_v6);
req->_present.peer_v6_len = len;
req->peer_v6 = malloc(req->_present.peer_v6_len);
memcpy(req->peer_v6, peer_v6, req->_present.peer_v6_len);
}
static inline void
fou_add_req_set_peer_port(struct fou_add_req *req,
__u16 peer_port /* big-endian */)
{
req->_present.peer_port = 1;
req->peer_port = peer_port;
}
static inline void
fou_add_req_set_ifindex(struct fou_add_req *req, __s32 ifindex)
{
req->_present.ifindex = 1;
req->ifindex = ifindex;
}
/*
* Add port.
*/
int fou_add(struct ynl_sock *ys, struct fou_add_req *req);
/* ============== FOU_CMD_DEL ============== */
/* FOU_CMD_DEL - do */
struct fou_del_req {
struct {
__u32 af:1;
__u32 ifindex:1;
__u32 port:1;
__u32 peer_port:1;
__u32 local_v4:1;
__u32 peer_v4:1;
__u32 local_v6_len;
__u32 peer_v6_len;
} _present;
__u8 af;
__s32 ifindex;
__u16 port /* big-endian */;
__u16 peer_port /* big-endian */;
__u32 local_v4;
__u32 peer_v4;
void *local_v6;
void *peer_v6;
};
static inline struct fou_del_req *fou_del_req_alloc(void)
{
return calloc(1, sizeof(struct fou_del_req));
}
void fou_del_req_free(struct fou_del_req *req);
static inline void fou_del_req_set_af(struct fou_del_req *req, __u8 af)
{
req->_present.af = 1;
req->af = af;
}
static inline void
fou_del_req_set_ifindex(struct fou_del_req *req, __s32 ifindex)
{
req->_present.ifindex = 1;
req->ifindex = ifindex;
}
static inline void
fou_del_req_set_port(struct fou_del_req *req, __u16 port /* big-endian */)
{
req->_present.port = 1;
req->port = port;
}
static inline void
fou_del_req_set_peer_port(struct fou_del_req *req,
__u16 peer_port /* big-endian */)
{
req->_present.peer_port = 1;
req->peer_port = peer_port;
}
static inline void
fou_del_req_set_local_v4(struct fou_del_req *req, __u32 local_v4)
{
req->_present.local_v4 = 1;
req->local_v4 = local_v4;
}
static inline void
fou_del_req_set_peer_v4(struct fou_del_req *req, __u32 peer_v4)
{
req->_present.peer_v4 = 1;
req->peer_v4 = peer_v4;
}
static inline void
fou_del_req_set_local_v6(struct fou_del_req *req, const void *local_v6,
size_t len)
{
free(req->local_v6);
req->_present.local_v6_len = len;
req->local_v6 = malloc(req->_present.local_v6_len);
memcpy(req->local_v6, local_v6, req->_present.local_v6_len);
}
static inline void
fou_del_req_set_peer_v6(struct fou_del_req *req, const void *peer_v6,
size_t len)
{
free(req->peer_v6);
req->_present.peer_v6_len = len;
req->peer_v6 = malloc(req->_present.peer_v6_len);
memcpy(req->peer_v6, peer_v6, req->_present.peer_v6_len);
}
/*
* Delete port.
*/
int fou_del(struct ynl_sock *ys, struct fou_del_req *req);
/* ============== FOU_CMD_GET ============== */
/* FOU_CMD_GET - do */
struct fou_get_req {
struct {
__u32 af:1;
__u32 ifindex:1;
__u32 port:1;
__u32 peer_port:1;
__u32 local_v4:1;
__u32 peer_v4:1;
__u32 local_v6_len;
__u32 peer_v6_len;
} _present;
__u8 af;
__s32 ifindex;
__u16 port /* big-endian */;
__u16 peer_port /* big-endian */;
__u32 local_v4;
__u32 peer_v4;
void *local_v6;
void *peer_v6;
};
static inline struct fou_get_req *fou_get_req_alloc(void)
{
return calloc(1, sizeof(struct fou_get_req));
}
void fou_get_req_free(struct fou_get_req *req);
static inline void fou_get_req_set_af(struct fou_get_req *req, __u8 af)
{
req->_present.af = 1;
req->af = af;
}
static inline void
fou_get_req_set_ifindex(struct fou_get_req *req, __s32 ifindex)
{
req->_present.ifindex = 1;
req->ifindex = ifindex;
}
static inline void
fou_get_req_set_port(struct fou_get_req *req, __u16 port /* big-endian */)
{
req->_present.port = 1;
req->port = port;
}
static inline void
fou_get_req_set_peer_port(struct fou_get_req *req,
__u16 peer_port /* big-endian */)
{
req->_present.peer_port = 1;
req->peer_port = peer_port;
}
static inline void
fou_get_req_set_local_v4(struct fou_get_req *req, __u32 local_v4)
{
req->_present.local_v4 = 1;
req->local_v4 = local_v4;
}
static inline void
fou_get_req_set_peer_v4(struct fou_get_req *req, __u32 peer_v4)
{
req->_present.peer_v4 = 1;
req->peer_v4 = peer_v4;
}
static inline void
fou_get_req_set_local_v6(struct fou_get_req *req, const void *local_v6,
size_t len)
{
free(req->local_v6);
req->_present.local_v6_len = len;
req->local_v6 = malloc(req->_present.local_v6_len);
memcpy(req->local_v6, local_v6, req->_present.local_v6_len);
}
static inline void
fou_get_req_set_peer_v6(struct fou_get_req *req, const void *peer_v6,
size_t len)
{
free(req->peer_v6);
req->_present.peer_v6_len = len;
req->peer_v6 = malloc(req->_present.peer_v6_len);
memcpy(req->peer_v6, peer_v6, req->_present.peer_v6_len);
}
struct fou_get_rsp {
struct {
__u32 port:1;
__u32 ipproto:1;
__u32 type:1;
__u32 remcsum_nopartial:1;
__u32 local_v4:1;
__u32 peer_v4:1;
__u32 local_v6_len;
__u32 peer_v6_len;
__u32 peer_port:1;
__u32 ifindex:1;
} _present;
__u16 port /* big-endian */;
__u8 ipproto;
__u8 type;
__u32 local_v4;
__u32 peer_v4;
void *local_v6;
void *peer_v6;
__u16 peer_port /* big-endian */;
__s32 ifindex;
};
void fou_get_rsp_free(struct fou_get_rsp *rsp);
/*
* Get tunnel info.
*/
struct fou_get_rsp *fou_get(struct ynl_sock *ys, struct fou_get_req *req);
/* FOU_CMD_GET - dump */
struct fou_get_list {
struct fou_get_list *next;
struct fou_get_rsp obj __attribute__((aligned(8)));
};
void fou_get_list_free(struct fou_get_list *rsp);
struct fou_get_list *fou_get_dump(struct ynl_sock *ys);
#endif /* _LINUX_FOU_GEN_H */
// SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)
/* Do not edit directly, auto-generated from: */
/* Documentation/netlink/specs/handshake.yaml */
/* YNL-GEN user source */
#include <stdlib.h>
#include <string.h>
#include "handshake-user.h"
#include "ynl.h"
#include <linux/handshake.h>
#include <libmnl/libmnl.h>
#include <linux/genetlink.h>
/* Enums */
static const char * const handshake_op_strmap[] = {
[HANDSHAKE_CMD_READY] = "ready",
[HANDSHAKE_CMD_ACCEPT] = "accept",
[HANDSHAKE_CMD_DONE] = "done",
};
const char *handshake_op_str(int op)
{
if (op < 0 || op >= (int)MNL_ARRAY_SIZE(handshake_op_strmap))
return NULL;
return handshake_op_strmap[op];
}
static const char * const handshake_handler_class_strmap[] = {
[0] = "none",
[1] = "tlshd",
[2] = "max",
};
const char *handshake_handler_class_str(enum handshake_handler_class value)
{
if (value < 0 || value >= (int)MNL_ARRAY_SIZE(handshake_handler_class_strmap))
return NULL;
return handshake_handler_class_strmap[value];
}
static const char * const handshake_msg_type_strmap[] = {
[0] = "unspec",
[1] = "clienthello",
[2] = "serverhello",
};
const char *handshake_msg_type_str(enum handshake_msg_type value)
{
if (value < 0 || value >= (int)MNL_ARRAY_SIZE(handshake_msg_type_strmap))
return NULL;
return handshake_msg_type_strmap[value];
}
static const char * const handshake_auth_strmap[] = {
[0] = "unspec",
[1] = "unauth",
[2] = "psk",
[3] = "x509",
};
const char *handshake_auth_str(enum handshake_auth value)
{
if (value < 0 || value >= (int)MNL_ARRAY_SIZE(handshake_auth_strmap))
return NULL;
return handshake_auth_strmap[value];
}
/* Policies */
struct ynl_policy_attr handshake_x509_policy[HANDSHAKE_A_X509_MAX + 1] = {
[HANDSHAKE_A_X509_CERT] = { .name = "cert", .type = YNL_PT_U32, },
[HANDSHAKE_A_X509_PRIVKEY] = { .name = "privkey", .type = YNL_PT_U32, },
};
struct ynl_policy_nest handshake_x509_nest = {
.max_attr = HANDSHAKE_A_X509_MAX,
.table = handshake_x509_policy,
};
struct ynl_policy_attr handshake_accept_policy[HANDSHAKE_A_ACCEPT_MAX + 1] = {
[HANDSHAKE_A_ACCEPT_SOCKFD] = { .name = "sockfd", .type = YNL_PT_U32, },
[HANDSHAKE_A_ACCEPT_HANDLER_CLASS] = { .name = "handler-class", .type = YNL_PT_U32, },
[HANDSHAKE_A_ACCEPT_MESSAGE_TYPE] = { .name = "message-type", .type = YNL_PT_U32, },
[HANDSHAKE_A_ACCEPT_TIMEOUT] = { .name = "timeout", .type = YNL_PT_U32, },
[HANDSHAKE_A_ACCEPT_AUTH_MODE] = { .name = "auth-mode", .type = YNL_PT_U32, },
[HANDSHAKE_A_ACCEPT_PEER_IDENTITY] = { .name = "peer-identity", .type = YNL_PT_U32, },
[HANDSHAKE_A_ACCEPT_CERTIFICATE] = { .name = "certificate", .type = YNL_PT_NEST, .nest = &handshake_x509_nest, },
[HANDSHAKE_A_ACCEPT_PEERNAME] = { .name = "peername", .type = YNL_PT_NUL_STR, },
};
struct ynl_policy_nest handshake_accept_nest = {
.max_attr = HANDSHAKE_A_ACCEPT_MAX,
.table = handshake_accept_policy,
};
struct ynl_policy_attr handshake_done_policy[HANDSHAKE_A_DONE_MAX + 1] = {
[HANDSHAKE_A_DONE_STATUS] = { .name = "status", .type = YNL_PT_U32, },
[HANDSHAKE_A_DONE_SOCKFD] = { .name = "sockfd", .type = YNL_PT_U32, },
[HANDSHAKE_A_DONE_REMOTE_AUTH] = { .name = "remote-auth", .type = YNL_PT_U32, },
};
struct ynl_policy_nest handshake_done_nest = {
.max_attr = HANDSHAKE_A_DONE_MAX,
.table = handshake_done_policy,
};
/* Common nested types */
void handshake_x509_free(struct handshake_x509 *obj)
{
}
int handshake_x509_parse(struct ynl_parse_arg *yarg,
const struct nlattr *nested)
{
struct handshake_x509 *dst = yarg->data;
const struct nlattr *attr;
mnl_attr_for_each_nested(attr, nested) {
unsigned int type = mnl_attr_get_type(attr);
if (type == HANDSHAKE_A_X509_CERT) {
if (ynl_attr_validate(yarg, attr))
return MNL_CB_ERROR;
dst->_present.cert = 1;
dst->cert = mnl_attr_get_u32(attr);
} else if (type == HANDSHAKE_A_X509_PRIVKEY) {
if (ynl_attr_validate(yarg, attr))
return MNL_CB_ERROR;
dst->_present.privkey = 1;
dst->privkey = mnl_attr_get_u32(attr);
}
}
return 0;
}
/* ============== HANDSHAKE_CMD_ACCEPT ============== */
/* HANDSHAKE_CMD_ACCEPT - do */
void handshake_accept_req_free(struct handshake_accept_req *req)
{
free(req);
}
void handshake_accept_rsp_free(struct handshake_accept_rsp *rsp)
{
unsigned int i;
free(rsp->peer_identity);
for (i = 0; i < rsp->n_certificate; i++)
handshake_x509_free(&rsp->certificate[i]);
free(rsp->certificate);
free(rsp->peername);
free(rsp);
}
int handshake_accept_rsp_parse(const struct nlmsghdr *nlh, void *data)
{
struct ynl_parse_arg *yarg = data;
struct handshake_accept_rsp *dst;
unsigned int n_peer_identity = 0;
unsigned int n_certificate = 0;
const struct nlattr *attr;
struct ynl_parse_arg parg;
int i;
dst = yarg->data;
parg.ys = yarg->ys;
if (dst->certificate)
return ynl_error_parse(yarg, "attribute already present (accept.certificate)");
if (dst->peer_identity)
return ynl_error_parse(yarg, "attribute already present (accept.peer-identity)");
mnl_attr_for_each(attr, nlh, sizeof(struct genlmsghdr)) {
unsigned int type = mnl_attr_get_type(attr);
if (type == HANDSHAKE_A_ACCEPT_SOCKFD) {
if (ynl_attr_validate(yarg, attr))
return MNL_CB_ERROR;
dst->_present.sockfd = 1;
dst->sockfd = mnl_attr_get_u32(attr);
} else if (type == HANDSHAKE_A_ACCEPT_MESSAGE_TYPE) {
if (ynl_attr_validate(yarg, attr))
return MNL_CB_ERROR;
dst->_present.message_type = 1;
dst->message_type = mnl_attr_get_u32(attr);
} else if (type == HANDSHAKE_A_ACCEPT_TIMEOUT) {
if (ynl_attr_validate(yarg, attr))
return MNL_CB_ERROR;
dst->_present.timeout = 1;
dst->timeout = mnl_attr_get_u32(attr);
} else if (type == HANDSHAKE_A_ACCEPT_AUTH_MODE) {
if (ynl_attr_validate(yarg, attr))
return MNL_CB_ERROR;
dst->_present.auth_mode = 1;
dst->auth_mode = mnl_attr_get_u32(attr);
} else if (type == HANDSHAKE_A_ACCEPT_PEER_IDENTITY) {
n_peer_identity++;
} else if (type == HANDSHAKE_A_ACCEPT_CERTIFICATE) {
n_certificate++;
} else if (type == HANDSHAKE_A_ACCEPT_PEERNAME) {
unsigned int len;
if (ynl_attr_validate(yarg, attr))
return MNL_CB_ERROR;
len = strnlen(mnl_attr_get_str(attr), mnl_attr_get_payload_len(attr));
dst->_present.peername_len = len;
dst->peername = malloc(len + 1);
memcpy(dst->peername, mnl_attr_get_str(attr), len);
dst->peername[len] = 0;
}
}
if (n_certificate) {
dst->certificate = calloc(n_certificate, sizeof(*dst->certificate));
dst->n_certificate = n_certificate;
i = 0;
parg.rsp_policy = &handshake_x509_nest;
mnl_attr_for_each(attr, nlh, sizeof(struct genlmsghdr)) {
if (mnl_attr_get_type(attr) == HANDSHAKE_A_ACCEPT_CERTIFICATE) {
parg.data = &dst->certificate[i];
if (handshake_x509_parse(&parg, attr))
return MNL_CB_ERROR;
i++;
}
}
}
if (n_peer_identity) {
dst->peer_identity = calloc(n_peer_identity, sizeof(*dst->peer_identity));
dst->n_peer_identity = n_peer_identity;
i = 0;
mnl_attr_for_each(attr, nlh, sizeof(struct genlmsghdr)) {
if (mnl_attr_get_type(attr) == HANDSHAKE_A_ACCEPT_PEER_IDENTITY) {
dst->peer_identity[i] = mnl_attr_get_u32(attr);
i++;
}
}
}
return MNL_CB_OK;
}
struct handshake_accept_rsp *
handshake_accept(struct ynl_sock *ys, struct handshake_accept_req *req)
{
struct ynl_req_state yrs = { .yarg = { .ys = ys, }, };
struct handshake_accept_rsp *rsp;
struct nlmsghdr *nlh;
int err;
nlh = ynl_gemsg_start_req(ys, ys->family_id, HANDSHAKE_CMD_ACCEPT, 1);
ys->req_policy = &handshake_accept_nest;
yrs.yarg.rsp_policy = &handshake_accept_nest;
if (req->_present.handler_class)
mnl_attr_put_u32(nlh, HANDSHAKE_A_ACCEPT_HANDLER_CLASS, req->handler_class);
rsp = calloc(1, sizeof(*rsp));
yrs.yarg.data = rsp;
yrs.cb = handshake_accept_rsp_parse;
yrs.rsp_cmd = HANDSHAKE_CMD_ACCEPT;
err = ynl_exec(ys, nlh, &yrs);
if (err < 0)
goto err_free;
return rsp;
err_free:
handshake_accept_rsp_free(rsp);
return NULL;
}
/* HANDSHAKE_CMD_ACCEPT - notify */
void handshake_accept_ntf_free(struct handshake_accept_ntf *rsp)
{
unsigned int i;
free(rsp->obj.peer_identity);
for (i = 0; i < rsp->obj.n_certificate; i++)
handshake_x509_free(&rsp->obj.certificate[i]);
free(rsp->obj.certificate);
free(rsp->obj.peername);
free(rsp);
}
/* ============== HANDSHAKE_CMD_DONE ============== */
/* HANDSHAKE_CMD_DONE - do */
void handshake_done_req_free(struct handshake_done_req *req)
{
free(req->remote_auth);
free(req);
}
int handshake_done(struct ynl_sock *ys, struct handshake_done_req *req)
{
struct ynl_req_state yrs = { .yarg = { .ys = ys, }, };
struct nlmsghdr *nlh;
int err;
nlh = ynl_gemsg_start_req(ys, ys->family_id, HANDSHAKE_CMD_DONE, 1);
ys->req_policy = &handshake_done_nest;
if (req->_present.status)
mnl_attr_put_u32(nlh, HANDSHAKE_A_DONE_STATUS, req->status);
if (req->_present.sockfd)
mnl_attr_put_u32(nlh, HANDSHAKE_A_DONE_SOCKFD, req->sockfd);
for (unsigned int i = 0; i < req->n_remote_auth; i++)
mnl_attr_put_u32(nlh, HANDSHAKE_A_DONE_REMOTE_AUTH, req->remote_auth[i]);
err = ynl_exec(ys, nlh, &yrs);
if (err < 0)
return -1;
return 0;
}
static const struct ynl_ntf_info handshake_ntf_info[] = {
[HANDSHAKE_CMD_READY] = {
.alloc_sz = sizeof(struct handshake_accept_ntf),
.cb = handshake_accept_rsp_parse,
.policy = &handshake_accept_nest,
.free = (void *)handshake_accept_ntf_free,
},
};
const struct ynl_family ynl_handshake_family = {
.name = "handshake",
.ntf_info = handshake_ntf_info,
.ntf_info_size = MNL_ARRAY_SIZE(handshake_ntf_info),
};
/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) */
/* Do not edit directly, auto-generated from: */
/* Documentation/netlink/specs/handshake.yaml */
/* YNL-GEN user header */
#ifndef _LINUX_HANDSHAKE_GEN_H
#define _LINUX_HANDSHAKE_GEN_H
#include <stdlib.h>
#include <string.h>
#include <linux/types.h>
#include <linux/handshake.h>
struct ynl_sock;
extern const struct ynl_family ynl_handshake_family;
/* Enums */
const char *handshake_op_str(int op);
const char *handshake_handler_class_str(enum handshake_handler_class value);
const char *handshake_msg_type_str(enum handshake_msg_type value);
const char *handshake_auth_str(enum handshake_auth value);
/* Common nested types */
struct handshake_x509 {
struct {
__u32 cert:1;
__u32 privkey:1;
} _present;
__s32 cert;
__s32 privkey;
};
/* ============== HANDSHAKE_CMD_ACCEPT ============== */
/* HANDSHAKE_CMD_ACCEPT - do */
struct handshake_accept_req {
struct {
__u32 handler_class:1;
} _present;
enum handshake_handler_class handler_class;
};
static inline struct handshake_accept_req *handshake_accept_req_alloc(void)
{
return calloc(1, sizeof(struct handshake_accept_req));
}
void handshake_accept_req_free(struct handshake_accept_req *req);
static inline void
handshake_accept_req_set_handler_class(struct handshake_accept_req *req,
enum handshake_handler_class handler_class)
{
req->_present.handler_class = 1;
req->handler_class = handler_class;
}
struct handshake_accept_rsp {
struct {
__u32 sockfd:1;
__u32 message_type:1;
__u32 timeout:1;
__u32 auth_mode:1;
__u32 peername_len;
} _present;
__s32 sockfd;
enum handshake_msg_type message_type;
__u32 timeout;
enum handshake_auth auth_mode;
unsigned int n_peer_identity;
__u32 *peer_identity;
unsigned int n_certificate;
struct handshake_x509 *certificate;
char *peername;
};
void handshake_accept_rsp_free(struct handshake_accept_rsp *rsp);
/*
* Handler retrieves next queued handshake request
*/
struct handshake_accept_rsp *
handshake_accept(struct ynl_sock *ys, struct handshake_accept_req *req);
/* HANDSHAKE_CMD_ACCEPT - notify */
struct handshake_accept_ntf {
__u16 family;
__u8 cmd;
struct ynl_ntf_base_type *next;
void (*free)(struct handshake_accept_ntf *ntf);
struct handshake_accept_rsp obj __attribute__((aligned(8)));
};
void handshake_accept_ntf_free(struct handshake_accept_ntf *rsp);
/* ============== HANDSHAKE_CMD_DONE ============== */
/* HANDSHAKE_CMD_DONE - do */
struct handshake_done_req {
struct {
__u32 status:1;
__u32 sockfd:1;
} _present;
__u32 status;
__s32 sockfd;
unsigned int n_remote_auth;
__u32 *remote_auth;
};
static inline struct handshake_done_req *handshake_done_req_alloc(void)
{
return calloc(1, sizeof(struct handshake_done_req));
}
void handshake_done_req_free(struct handshake_done_req *req);
static inline void
handshake_done_req_set_status(struct handshake_done_req *req, __u32 status)
{
req->_present.status = 1;
req->status = status;
}
static inline void
handshake_done_req_set_sockfd(struct handshake_done_req *req, __s32 sockfd)
{
req->_present.sockfd = 1;
req->sockfd = sockfd;
}
static inline void
__handshake_done_req_set_remote_auth(struct handshake_done_req *req,
__u32 *remote_auth,
unsigned int n_remote_auth)
{
free(req->remote_auth);
req->remote_auth = remote_auth;
req->n_remote_auth = n_remote_auth;
}
/*
* Handler reports handshake completion
*/
int handshake_done(struct ynl_sock *ys, struct handshake_done_req *req);
#endif /* _LINUX_HANDSHAKE_GEN_H */
This diff is collapsed.
This diff is collapsed.
// 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 */
int nfsd_rpc_status_get_rsp_dump_parse(const struct nlmsghdr *nlh, void *data)
{
struct nfsd_rpc_status_get_rsp_dump *dst;
struct ynl_parse_arg *yarg = data;
unsigned int n_compound_ops = 0;
const struct nlattr *attr;
int i;
dst = yarg->data;
if (dst->compound_ops)
return ynl_error_parse(yarg, "attribute already present (rpc-status.compound-ops)");
mnl_attr_for_each(attr, nlh, sizeof(struct genlmsghdr)) {
unsigned int type = mnl_attr_get_type(attr);
if (type == NFSD_A_RPC_STATUS_XID) {
if (ynl_attr_validate(yarg, attr))
return MNL_CB_ERROR;
dst->_present.xid = 1;
dst->xid = mnl_attr_get_u32(attr);
} else if (type == NFSD_A_RPC_STATUS_FLAGS) {
if (ynl_attr_validate(yarg, attr))
return MNL_CB_ERROR;
dst->_present.flags = 1;
dst->flags = mnl_attr_get_u32(attr);
} else if (type == NFSD_A_RPC_STATUS_PROG) {
if (ynl_attr_validate(yarg, attr))
return MNL_CB_ERROR;
dst->_present.prog = 1;
dst->prog = mnl_attr_get_u32(attr);
} else if (type == NFSD_A_RPC_STATUS_VERSION) {
if (ynl_attr_validate(yarg, attr))
return MNL_CB_ERROR;
dst->_present.version = 1;
dst->version = mnl_attr_get_u8(attr);
} else if (type == NFSD_A_RPC_STATUS_PROC) {
if (ynl_attr_validate(yarg, attr))
return MNL_CB_ERROR;
dst->_present.proc = 1;
dst->proc = mnl_attr_get_u32(attr);
} else if (type == NFSD_A_RPC_STATUS_SERVICE_TIME) {
if (ynl_attr_validate(yarg, attr))
return MNL_CB_ERROR;
dst->_present.service_time = 1;
dst->service_time = mnl_attr_get_u64(attr);
} else if (type == NFSD_A_RPC_STATUS_SADDR4) {
if (ynl_attr_validate(yarg, attr))
return MNL_CB_ERROR;
dst->_present.saddr4 = 1;
dst->saddr4 = mnl_attr_get_u32(attr);
} else if (type == NFSD_A_RPC_STATUS_DADDR4) {
if (ynl_attr_validate(yarg, attr))
return MNL_CB_ERROR;
dst->_present.daddr4 = 1;
dst->daddr4 = mnl_attr_get_u32(attr);
} else if (type == NFSD_A_RPC_STATUS_SADDR6) {
unsigned int len;
if (ynl_attr_validate(yarg, attr))
return MNL_CB_ERROR;
len = mnl_attr_get_payload_len(attr);
dst->_present.saddr6_len = len;
dst->saddr6 = malloc(len);
memcpy(dst->saddr6, mnl_attr_get_payload(attr), len);
} else if (type == NFSD_A_RPC_STATUS_DADDR6) {
unsigned int len;
if (ynl_attr_validate(yarg, attr))
return MNL_CB_ERROR;
len = mnl_attr_get_payload_len(attr);
dst->_present.daddr6_len = len;
dst->daddr6 = malloc(len);
memcpy(dst->daddr6, mnl_attr_get_payload(attr), len);
} else if (type == NFSD_A_RPC_STATUS_SPORT) {
if (ynl_attr_validate(yarg, attr))
return MNL_CB_ERROR;
dst->_present.sport = 1;
dst->sport = mnl_attr_get_u16(attr);
} else if (type == NFSD_A_RPC_STATUS_DPORT) {
if (ynl_attr_validate(yarg, attr))
return MNL_CB_ERROR;
dst->_present.dport = 1;
dst->dport = mnl_attr_get_u16(attr);
} else if (type == NFSD_A_RPC_STATUS_COMPOUND_OPS) {
n_compound_ops++;
}
}
if (n_compound_ops) {
dst->compound_ops = calloc(n_compound_ops, sizeof(*dst->compound_ops));
dst->n_compound_ops = n_compound_ops;
i = 0;
mnl_attr_for_each(attr, nlh, sizeof(struct genlmsghdr)) {
if (mnl_attr_get_type(attr) == NFSD_A_RPC_STATUS_COMPOUND_OPS) {
dst->compound_ops[i] = mnl_attr_get_u32(attr);
i++;
}
}
}
return MNL_CB_OK;
}
void
nfsd_rpc_status_get_rsp_list_free(struct nfsd_rpc_status_get_rsp_list *rsp)
{
struct nfsd_rpc_status_get_rsp_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_rsp_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_rsp_list);
yds.cb = nfsd_rpc_status_get_rsp_dump_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_rsp_list_free(yds.first);
return NULL;
}
const struct ynl_family ynl_nfsd_family = {
.name = "nfsd",
};
/* 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_rsp_dump {
struct {
__u32 xid:1;
__u32 flags:1;
__u32 prog:1;
__u32 version:1;
__u32 proc:1;
__u32 service_time:1;
__u32 saddr4:1;
__u32 daddr4:1;
__u32 saddr6_len;
__u32 daddr6_len;
__u32 sport:1;
__u32 dport:1;
} _present;
__u32 xid /* big-endian */;
__u32 flags;
__u32 prog;
__u8 version;
__u32 proc;
__s64 service_time;
__u32 saddr4 /* big-endian */;
__u32 daddr4 /* big-endian */;
void *saddr6;
void *daddr6;
__u16 sport /* big-endian */;
__u16 dport /* big-endian */;
unsigned int n_compound_ops;
__u32 *compound_ops;
};
struct nfsd_rpc_status_get_rsp_list {
struct nfsd_rpc_status_get_rsp_list *next;
struct nfsd_rpc_status_get_rsp_dump obj __attribute__((aligned(8)));
};
void
nfsd_rpc_status_get_rsp_list_free(struct nfsd_rpc_status_get_rsp_list *rsp);
struct nfsd_rpc_status_get_rsp_list *
nfsd_rpc_status_get_dump(struct ynl_sock *ys);
#endif /* _LINUX_NFSD_GEN_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment