1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159
#include <linux/sunrpc/svc.h>
#include "nfs4xdr_gen.h"
static bool __maybe_unused
xdrgen_decode_int32_t(struct xdr_stream *xdr, int32_t *ptr)
{
return xdrgen_decode_int(xdr, ptr);
}
static bool __maybe_unused
xdrgen_decode_uint32_t(struct xdr_stream *xdr, uint32_t *ptr)
{
return xdrgen_decode_unsigned_int(xdr, ptr);
}
static bool __maybe_unused
xdrgen_decode_int64_t(struct xdr_stream *xdr, int64_t *ptr)
{
return xdrgen_decode_hyper(xdr, ptr);
}
static bool __maybe_unused
xdrgen_decode_uint64_t(struct xdr_stream *xdr, uint64_t *ptr)
{
return xdrgen_decode_unsigned_hyper(xdr, ptr);
}
static bool __maybe_unused
xdrgen_decode_nfsstat4(struct xdr_stream *xdr, nfsstat4 *ptr)
{
u32 val;
if (xdr_stream_decode_u32(xdr, &val) < 0)
return false;
switch (val) {
case NFS4_OK:
case NFS4ERR_PERM:
case NFS4ERR_NOENT:
case NFS4ERR_IO:
case NFS4ERR_NXIO:
case NFS4ERR_ACCESS:
case NFS4ERR_EXIST:
case NFS4ERR_XDEV:
case NFS4ERR_NOTDIR:
case NFS4ERR_ISDIR:
case NFS4ERR_INVAL:
case NFS4ERR_FBIG:
case NFS4ERR_NOSPC:
case NFS4ERR_ROFS:
case NFS4ERR_MLINK:
case NFS4ERR_NAMETOOLONG:
case NFS4ERR_NOTEMPTY:
case NFS4ERR_DQUOT:
case NFS4ERR_STALE:
case NFS4ERR_BADHANDLE:
case NFS4ERR_BAD_COOKIE:
case NFS4ERR_NOTSUPP:
case NFS4ERR_TOOSMALL:
case NFS4ERR_SERVERFAULT:
case NFS4ERR_BADTYPE:
case NFS4ERR_DELAY:
case NFS4ERR_SAME:
case NFS4ERR_DENIED:
case NFS4ERR_EXPIRED:
case NFS4ERR_LOCKED:
case NFS4ERR_GRACE:
case NFS4ERR_FHEXPIRED:
case NFS4ERR_SHARE_DENIED:
case NFS4ERR_WRONGSEC:
case NFS4ERR_CLID_INUSE:
case NFS4ERR_RESOURCE:
case NFS4ERR_MOVED:
case NFS4ERR_NOFILEHANDLE:
case NFS4ERR_MINOR_VERS_MISMATCH:
case NFS4ERR_STALE_CLIENTID:
case NFS4ERR_STALE_STATEID:
case NFS4ERR_OLD_STATEID:
case NFS4ERR_BAD_STATEID:
case NFS4ERR_BAD_SEQID:
case NFS4ERR_NOT_SAME:
case NFS4ERR_LOCK_RANGE:
case NFS4ERR_SYMLINK:
case NFS4ERR_RESTOREFH:
case NFS4ERR_LEASE_MOVED:
case NFS4ERR_ATTRNOTSUPP:
case NFS4ERR_NO_GRACE:
case NFS4ERR_RECLAIM_BAD:
case NFS4ERR_RECLAIM_CONFLICT:
case NFS4ERR_BADXDR:
case NFS4ERR_LOCKS_HELD:
case NFS4ERR_OPENMODE:
case NFS4ERR_BADOWNER:
case NFS4ERR_BADCHAR:
case NFS4ERR_BADNAME:
case NFS4ERR_BAD_RANGE:
case NFS4ERR_LOCK_NOTSUPP:
case NFS4ERR_OP_ILLEGAL:
case NFS4ERR_DEADLOCK:
case NFS4ERR_FILE_OPEN:
case NFS4ERR_ADMIN_REVOKED:
case NFS4ERR_CB_PATH_DOWN:
case NFS4ERR_BADIOMODE:
case NFS4ERR_BADLAYOUT:
case NFS4ERR_BAD_SESSION_DIGEST:
case NFS4ERR_BADSESSION:
case NFS4ERR_BADSLOT:
case NFS4ERR_COMPLETE_ALREADY:
case NFS4ERR_CONN_NOT_BOUND_TO_SESSION:
case NFS4ERR_DELEG_ALREADY_WANTED:
case NFS4ERR_BACK_CHAN_BUSY:
case NFS4ERR_LAYOUTTRYLATER:
case NFS4ERR_LAYOUTUNAVAILABLE:
case NFS4ERR_NOMATCHING_LAYOUT:
case NFS4ERR_RECALLCONFLICT:
case NFS4ERR_UNKNOWN_LAYOUTTYPE:
case NFS4ERR_SEQ_MISORDERED:
case NFS4ERR_SEQUENCE_POS:
case NFS4ERR_REQ_TOO_BIG:
case NFS4ERR_REP_TOO_BIG:
case NFS4ERR_REP_TOO_BIG_TO_CACHE:
case NFS4ERR_RETRY_UNCACHED_REP:
case NFS4ERR_UNSAFE_COMPOUND:
case NFS4ERR_TOO_MANY_OPS:
case NFS4ERR_OP_NOT_IN_SESSION:
case NFS4ERR_HASH_ALG_UNSUPP:
case NFS4ERR_CLIENTID_BUSY:
case NFS4ERR_PNFS_IO_HOLE:
case NFS4ERR_SEQ_FALSE_RETRY:
case NFS4ERR_BAD_HIGH_SLOT:
case NFS4ERR_DEADSESSION:
case NFS4ERR_ENCR_ALG_UNSUPP:
case NFS4ERR_PNFS_NO_LAYOUT:
case NFS4ERR_NOT_ONLY_OP:
case NFS4ERR_WRONG_CRED:
case NFS4ERR_WRONG_TYPE:
case NFS4ERR_DIRDELEG_UNAVAIL:
case NFS4ERR_REJECT_DELEG:
case NFS4ERR_RETURNCONFLICT:
case NFS4ERR_DELEG_REVOKED:
case NFS4ERR_PARTNER_NOTSUPP:
case NFS4ERR_PARTNER_NO_AUTH:
case NFS4ERR_UNION_NOTSUPP:
case NFS4ERR_OFFLOAD_DENIED:
case NFS4ERR_WRONG_LFS:
case NFS4ERR_BADLABEL:
case NFS4ERR_OFFLOAD_NO_REQS:
case NFS4ERR_NOXATTR:
case NFS4ERR_XATTR2BIG:
break;
default:
return false;
}
*ptr = val;
return true;
}
static bool __maybe_unused
xdrgen_decode_attrlist4(struct xdr_stream *xdr, attrlist4 *ptr)
{
return xdrgen_decode_opaque(xdr, ptr, 0);
}
static bool __maybe_unused
xdrgen_decode_bitmap4(struct xdr_stream *xdr, bitmap4 *ptr)
{
if (xdr_stream_decode_u32(xdr, &ptr->count) < 0)
return false;
for (u32 i = 0; i < ptr->count; i++)
if (!xdrgen_decode_uint32_t(xdr, &ptr->element[i]))
return false;
return true;
}
static bool __maybe_unused
xdrgen_decode_verifier4(struct xdr_stream *xdr, verifier4 *ptr)
{
return xdr_stream_decode_opaque_fixed(xdr, ptr, NFS4_VERIFIER_SIZE) == 0;
}
static bool __maybe_unused
xdrgen_decode_nfs_cookie4(struct xdr_stream *xdr, nfs_cookie4 *ptr)
{
return xdrgen_decode_uint64_t(xdr, ptr);
}
static bool __maybe_unused
xdrgen_decode_nfs_fh4(struct xdr_stream *xdr, nfs_fh4 *ptr)
{
return xdrgen_decode_opaque(xdr, ptr, NFS4_FHSIZE);
}
static bool __maybe_unused
xdrgen_decode_utf8string(struct xdr_stream *xdr, utf8string *ptr)
{
return xdrgen_decode_opaque(xdr, ptr, 0);
}
static bool __maybe_unused
xdrgen_decode_utf8str_cis(struct xdr_stream *xdr, utf8str_cis *ptr)
{
return xdrgen_decode_utf8string(xdr, ptr);
}
static bool __maybe_unused
xdrgen_decode_utf8str_cs(struct xdr_stream *xdr, utf8str_cs *ptr)
{
return xdrgen_decode_utf8string(xdr, ptr);
}
static bool __maybe_unused
xdrgen_decode_utf8str_mixed(struct xdr_stream *xdr, utf8str_mixed *ptr)
{
return xdrgen_decode_utf8string(xdr, ptr);
}
static bool __maybe_unused
xdrgen_decode_component4(struct xdr_stream *xdr, component4 *ptr)
{
return xdrgen_decode_utf8str_cs(xdr, ptr);
}
static bool __maybe_unused
xdrgen_decode_linktext4(struct xdr_stream *xdr, linktext4 *ptr)
{
return xdrgen_decode_utf8str_cs(xdr, ptr);
}
static bool __maybe_unused
xdrgen_decode_pathname4(struct xdr_stream *xdr, pathname4 *ptr)
{
if (xdr_stream_decode_u32(xdr, &ptr->count) < 0)
return false;
for (u32 i = 0; i < ptr->count; i++)
if (!xdrgen_decode_component4(xdr, &ptr->element[i]))
return false;
return true;
}
static bool __maybe_unused
xdrgen_decode_nfstime4(struct xdr_stream *xdr, struct nfstime4 *ptr)
{
if (!xdrgen_decode_int64_t(xdr, &ptr->seconds))
return false;
if (!xdrgen_decode_uint32_t(xdr, &ptr->nseconds))
return false;
return true;
}
static bool __maybe_unused
xdrgen_decode_fattr4(struct xdr_stream *xdr, struct fattr4 *ptr)
{
if (!xdrgen_decode_bitmap4(xdr, &ptr->attrmask))
return false;
if (!xdrgen_decode_attrlist4(xdr, &ptr->attr_vals))
return false;
return true;
}
static bool __maybe_unused
xdrgen_decode_stateid4(struct xdr_stream *xdr, struct stateid4 *ptr)
{
if (!xdrgen_decode_uint32_t(xdr, &ptr->seqid))
return false;
if (xdr_stream_decode_opaque_fixed(xdr, ptr->other, 12) < 0)
return false;
return true;
}
static bool __maybe_unused
xdrgen_decode_fattr4_offline(struct xdr_stream *xdr, fattr4_offline *ptr)
{
return xdrgen_decode_bool(xdr, ptr);
}
static bool __maybe_unused
xdrgen_decode_open_arguments4(struct xdr_stream *xdr, struct open_arguments4 *ptr)
{
if (!xdrgen_decode_bitmap4(xdr, &ptr->oa_share_access))
return false;
if (!xdrgen_decode_bitmap4(xdr, &ptr->oa_share_deny))
return false;
if (!xdrgen_decode_bitmap4(xdr, &ptr->oa_share_access_want))
return false;
if (!xdrgen_decode_bitmap4(xdr, &ptr->oa_open_claim))
return false;
if (!xdrgen_decode_bitmap4(xdr, &ptr->oa_create_mode))
return false;
return true;
}
static bool __maybe_unused
xdrgen_decode_open_args_share_access4(struct xdr_stream *xdr, open_args_share_access4 *ptr)
{
u32 val;
if (xdr_stream_decode_u32(xdr, &val) < 0)
return false;
switch (val) {
case OPEN_ARGS_SHARE_ACCESS_READ:
case OPEN_ARGS_SHARE_ACCESS_WRITE:
case OPEN_ARGS_SHARE_ACCESS_BOTH:
break;
default:
return false;
}
*ptr = val;
return true;
}
static bool __maybe_unused
xdrgen_decode_open_args_share_deny4(struct xdr_stream *xdr, open_args_share_deny4 *ptr)
{
u32 val;
if (xdr_stream_decode_u32(xdr, &val) < 0)
return false;
switch (val) {
case OPEN_ARGS_SHARE_DENY_NONE:
case OPEN_ARGS_SHARE_DENY_READ:
case OPEN_ARGS_SHARE_DENY_WRITE:
case OPEN_ARGS_SHARE_DENY_BOTH:
break;
default:
return false;
}
*ptr = val;
return true;
}
static bool __maybe_unused
xdrgen_decode_open_args_share_access_want4(struct xdr_stream *xdr, open_args_share_access_want4 *ptr)
{
u32 val;
if (xdr_stream_decode_u32(xdr, &val) < 0)
return false;
switch (val) {
case OPEN_ARGS_SHARE_ACCESS_WANT_ANY_DELEG:
case OPEN_ARGS_SHARE_ACCESS_WANT_NO_DELEG:
case OPEN_ARGS_SHARE_ACCESS_WANT_CANCEL:
case OPEN_ARGS_SHARE_ACCESS_WANT_SIGNAL_DELEG_WHEN_RESRC_AVAIL:
case OPEN_ARGS_SHARE_ACCESS_WANT_PUSH_DELEG_WHEN_UNCONTENDED:
case OPEN_ARGS_SHARE_ACCESS_WANT_DELEG_TIMESTAMPS:
case OPEN_ARGS_SHARE_ACCESS_WANT_OPEN_XOR_DELEGATION:
break;
default:
return false;
}
*ptr = val;
return true;
}
static bool __maybe_unused
xdrgen_decode_open_args_open_claim4(struct xdr_stream *xdr, open_args_open_claim4 *ptr)
{
u32 val;
if (xdr_stream_decode_u32(xdr, &val) < 0)
return false;
switch (val) {
case OPEN_ARGS_OPEN_CLAIM_NULL:
case OPEN_ARGS_OPEN_CLAIM_PREVIOUS:
case OPEN_ARGS_OPEN_CLAIM_DELEGATE_CUR:
case OPEN_ARGS_OPEN_CLAIM_DELEGATE_PREV:
case OPEN_ARGS_OPEN_CLAIM_FH:
case OPEN_ARGS_OPEN_CLAIM_DELEG_CUR_FH:
case OPEN_ARGS_OPEN_CLAIM_DELEG_PREV_FH:
break;
default:
return false;
}
*ptr = val;
return true;
}
static bool __maybe_unused
xdrgen_decode_open_args_createmode4(struct xdr_stream *xdr, open_args_createmode4 *ptr)
{
u32 val;
if (xdr_stream_decode_u32(xdr, &val) < 0)
return false;
switch (val) {
case OPEN_ARGS_CREATEMODE_UNCHECKED4:
case OPEN_ARGS_CREATE_MODE_GUARDED:
case OPEN_ARGS_CREATEMODE_EXCLUSIVE4:
case OPEN_ARGS_CREATE_MODE_EXCLUSIVE4_1:
break;
default:
return false;
}
*ptr = val;
return true;
}
bool
xdrgen_decode_fattr4_open_arguments(struct xdr_stream *xdr, fattr4_open_arguments *ptr)
{
return xdrgen_decode_open_arguments4(xdr, ptr);
}
bool
xdrgen_decode_fattr4_time_deleg_access(struct xdr_stream *xdr, fattr4_time_deleg_access *ptr)
{
return xdrgen_decode_nfstime4(xdr, ptr);
}
bool
xdrgen_decode_fattr4_time_deleg_modify(struct xdr_stream *xdr, fattr4_time_deleg_modify *ptr)
{
return xdrgen_decode_nfstime4(xdr, ptr);
}
static bool __maybe_unused
xdrgen_decode_open_delegation_type4(struct xdr_stream *xdr, open_delegation_type4 *ptr)
{
u32 val;
if (xdr_stream_decode_u32(xdr, &val) < 0)
return false;
switch (val) {
case OPEN_DELEGATE_NONE:
case OPEN_DELEGATE_READ:
case OPEN_DELEGATE_WRITE:
case OPEN_DELEGATE_NONE_EXT:
case OPEN_DELEGATE_READ_ATTRS_DELEG:
case OPEN_DELEGATE_WRITE_ATTRS_DELEG:
break;
default:
return false;
}
*ptr = val;
return true;
}
bool
xdrgen_decode_aclmodel4(struct xdr_stream *xdr, aclmodel4 *ptr)
{
u32 val;
if (xdr_stream_decode_u32(xdr, &val) < 0)
return false;
switch (val) {
case ACL_MODEL_NFS4:
case ACL_MODEL_POSIX_DRAFT:
case ACL_MODEL_NONE:
break;
default:
return false;
}
*ptr = val;
return true;
}
bool
xdrgen_decode_aclscope4(struct xdr_stream *xdr, aclscope4 *ptr)
{
u32 val;
if (xdr_stream_decode_u32(xdr, &val) < 0)
return false;
switch (val) {
case ACL_SCOPE_FILE_OBJECT:
case ACL_SCOPE_FILE_SYSTEM:
case ACL_SCOPE_SERVER:
break;
default:
return false;
}
*ptr = val;
return true;
}
bool
xdrgen_decode_posixacetag4(struct xdr_stream *xdr, posixacetag4 *ptr)
{
u32 val;
if (xdr_stream_decode_u32(xdr, &val) < 0)
return false;
switch (val) {
case POSIXACE4_TAG_USER_OBJ:
case POSIXACE4_TAG_USER:
case POSIXACE4_TAG_GROUP_OBJ:
case POSIXACE4_TAG_GROUP:
case POSIXACE4_TAG_MASK:
case POSIXACE4_TAG_OTHER:
break;
default:
return false;
}
*ptr = val;
return true;
}
bool
xdrgen_decode_posixaceperm4(struct xdr_stream *xdr, posixaceperm4 *ptr)
{
return xdrgen_decode_uint32_t(xdr, ptr);
}
static bool __maybe_unused
xdrgen_decode_posixace4(struct xdr_stream *xdr, struct posixace4 *ptr)
{
if (!xdrgen_decode_posixacetag4(xdr, &ptr->tag))
return false;
if (!xdrgen_decode_posixaceperm4(xdr, &ptr->perm))
return false;
if (!xdrgen_decode_utf8str_mixed(xdr, &ptr->who))
return false;
return true;
}
static bool __maybe_unused
xdrgen_decode_fattr4_acl_trueform(struct xdr_stream *xdr, fattr4_acl_trueform *ptr)
{
return xdrgen_decode_aclmodel4(xdr, ptr);
}
static bool __maybe_unused
xdrgen_decode_fattr4_acl_trueform_scope(struct xdr_stream *xdr, fattr4_acl_trueform_scope *ptr)
{
return xdrgen_decode_aclscope4(xdr, ptr);
}
static bool __maybe_unused
xdrgen_decode_fattr4_posix_default_acl(struct xdr_stream *xdr, fattr4_posix_default_acl *ptr)
{
if (xdr_stream_decode_u32(xdr, &ptr->count) < 0)
return false;
for (u32 i = 0; i < ptr->count; i++)
if (!xdrgen_decode_posixace4(xdr, &ptr->element[i]))
return false;
return true;
}
static bool __maybe_unused
xdrgen_decode_fattr4_posix_access_acl(struct xdr_stream *xdr, fattr4_posix_access_acl *ptr)
{
if (xdr_stream_decode_u32(xdr, &ptr->count) < 0)
return false;
for (u32 i = 0; i < ptr->count; i++)
if (!xdrgen_decode_posixace4(xdr, &ptr->element[i]))
return false;
return true;
}
static bool __maybe_unused
xdrgen_decode_notify_type4(struct xdr_stream *xdr, notify_type4 *ptr)
{
u32 val;
if (xdr_stream_decode_u32(xdr, &val) < 0)
return false;
switch (val) {
case NOTIFY4_CHANGE_CHILD_ATTRS:
case NOTIFY4_CHANGE_DIR_ATTRS:
case NOTIFY4_REMOVE_ENTRY:
case NOTIFY4_ADD_ENTRY:
case NOTIFY4_RENAME_ENTRY:
case NOTIFY4_CHANGE_COOKIE_VERIFIER:
case NOTIFY4_GFLAG_EXTEND:
case NOTIFY4_AUFLAG_VALID:
case NOTIFY4_AUFLAG_USER:
case NOTIFY4_AUFLAG_GROUP:
case NOTIFY4_AUFLAG_OTHER:
case NOTIFY4_CHANGE_AUTH:
case NOTIFY4_CFLAG_ORDER:
case NOTIFY4_AUFLAG_GANOW:
case NOTIFY4_AUFLAG_GALATER:
case NOTIFY4_CHANGE_GA:
case NOTIFY4_CHANGE_AMASK:
break;
default:
return false;
}
*ptr = val;
return true;
}
static bool __maybe_unused
xdrgen_decode_notify_entry4(struct xdr_stream *xdr, struct notify_entry4 *ptr)
{
if (!xdrgen_decode_component4(xdr, &ptr->ne_file))
return false;
if (!xdrgen_decode_fattr4(xdr, &ptr->ne_attrs))
return false;
return true;
}
static bool __maybe_unused
xdrgen_decode_prev_entry4(struct xdr_stream *xdr, struct prev_entry4 *ptr)
{
if (!xdrgen_decode_notify_entry4(xdr, &ptr->pe_prev_entry))
return false;
if (!xdrgen_decode_nfs_cookie4(xdr, &ptr->pe_prev_entry_cookie))
return false;
return true;
}
bool
xdrgen_decode_notify_remove4(struct xdr_stream *xdr, struct notify_remove4 *ptr)
{
if (!xdrgen_decode_notify_entry4(xdr, &ptr->nrm_old_entry))
return false;
if (!xdrgen_decode_nfs_cookie4(xdr, &ptr->nrm_old_entry_cookie))
return false;
return true;
}
bool
xdrgen_decode_notify_add4(struct xdr_stream *xdr, struct notify_add4 *ptr)
{
if (xdr_stream_decode_u32(xdr, &ptr->nad_old_entry.count) < 0)
return false;
if (ptr->nad_old_entry.count > 1)
return false;
for (u32 i = 0; i < ptr->nad_old_entry.count; i++)
if (!xdrgen_decode_notify_remove4(xdr, &ptr->nad_old_entry.element[i]))
return false;
if (!xdrgen_decode_notify_entry4(xdr, &ptr->nad_new_entry))
return false;
if (xdr_stream_decode_u32(xdr, &ptr->nad_new_entry_cookie.count) < 0)
return false;
if (ptr->nad_new_entry_cookie.count > 1)
return false;
for (u32 i = 0; i < ptr->nad_new_entry_cookie.count; i++)
if (!xdrgen_decode_nfs_cookie4(xdr, &ptr->nad_new_entry_cookie.element[i]))
return false;
if (xdr_stream_decode_u32(xdr, &ptr->nad_prev_entry.count) < 0)
return false;
if (ptr->nad_prev_entry.count > 1)
return false;
for (u32 i = 0; i < ptr->nad_prev_entry.count; i++)
if (!xdrgen_decode_prev_entry4(xdr, &ptr->nad_prev_entry.element[i]))
return false;
if (!xdrgen_decode_bool(xdr, &ptr->nad_last_entry))
return false;
return true;
}
bool
xdrgen_decode_notify_attr4(struct xdr_stream *xdr, struct notify_attr4 *ptr)
{
if (!xdrgen_decode_notify_entry4(xdr, &ptr->na_changed_entry))
return false;
return true;
}
bool
xdrgen_decode_notify_rename4(struct xdr_stream *xdr, struct notify_rename4 *ptr)
{
if (!xdrgen_decode_notify_remove4(xdr, &ptr->nrn_old_entry))
return false;
if (!xdrgen_decode_notify_add4(xdr, &ptr->nrn_new_entry))
return false;
return true;
}
static bool __maybe_unused
xdrgen_decode_notify_verifier4(struct xdr_stream *xdr, struct notify_verifier4 *ptr)
{
if (!xdrgen_decode_verifier4(xdr, &ptr->nv_old_cookieverf))
return false;
if (!xdrgen_decode_verifier4(xdr, &ptr->nv_new_cookieverf))
return false;
return true;
}
static bool __maybe_unused
xdrgen_decode_notifylist4(struct xdr_stream *xdr, notifylist4 *ptr)
{
return xdrgen_decode_opaque(xdr, ptr, 0);
}
static bool __maybe_unused
xdrgen_decode_notify4(struct xdr_stream *xdr, struct notify4 *ptr)
{
if (!xdrgen_decode_bitmap4(xdr, &ptr->notify_mask))
return false;
if (!xdrgen_decode_notifylist4(xdr, &ptr->notify_vals))
return false;
return true;
}
bool
xdrgen_decode_CB_NOTIFY4args(struct xdr_stream *xdr, struct CB_NOTIFY4args *ptr)
{
if (!xdrgen_decode_stateid4(xdr, &ptr->cna_stateid))
return false;
if (!xdrgen_decode_nfs_fh4(xdr, &ptr->cna_fh))
return false;
if (xdr_stream_decode_u32(xdr, &ptr->cna_changes.count) < 0)
return false;
for (u32 i = 0; i < ptr->cna_changes.count; i++)
if (!xdrgen_decode_notify4(xdr, &ptr->cna_changes.element[i]))
return false;
return true;
}
static bool __maybe_unused
xdrgen_decode_CB_NOTIFY4res(struct xdr_stream *xdr, struct CB_NOTIFY4res *ptr)
{
if (!xdrgen_decode_nfsstat4(xdr, &ptr->cnr_status))
return false;
return true;
}
static bool __maybe_unused
xdrgen_encode_int32_t(struct xdr_stream *xdr, const int32_t value)
{
return xdrgen_encode_int(xdr, value);
}
static bool __maybe_unused
xdrgen_encode_uint32_t(struct xdr_stream *xdr, const uint32_t value)
{
return xdrgen_encode_unsigned_int(xdr, value);
}
static bool __maybe_unused
xdrgen_encode_int64_t(struct xdr_stream *xdr, const int64_t value)
{
return xdrgen_encode_hyper(xdr, value);
}
static bool __maybe_unused
xdrgen_encode_uint64_t(struct xdr_stream *xdr, const uint64_t value)
{
return xdrgen_encode_unsigned_hyper(xdr, value);
}
static bool __maybe_unused
xdrgen_encode_nfsstat4(struct xdr_stream *xdr, nfsstat4 value)
{
return xdr_stream_encode_u32(xdr, value) == XDR_UNIT;
}
static bool __maybe_unused
xdrgen_encode_attrlist4(struct xdr_stream *xdr, const attrlist4 value)
{
return xdr_stream_encode_opaque(xdr, value.data, value.len) >= 0;
}
static bool __maybe_unused
xdrgen_encode_bitmap4(struct xdr_stream *xdr, const bitmap4 value)
{
if (xdr_stream_encode_u32(xdr, value.count) != XDR_UNIT)
return false;
for (u32 i = 0; i < value.count; i++)
if (!xdrgen_encode_uint32_t(xdr, value.element[i]))
return false;
return true;
}
static bool __maybe_unused
xdrgen_encode_verifier4(struct xdr_stream *xdr, const verifier4 value)
{
return xdr_stream_encode_opaque_fixed(xdr, value, NFS4_VERIFIER_SIZE) >= 0;
}
static bool __maybe_unused
xdrgen_encode_nfs_cookie4(struct xdr_stream *xdr, const nfs_cookie4 value)
{
return xdrgen_encode_uint64_t(xdr, value);
}
static bool __maybe_unused
xdrgen_encode_nfs_fh4(struct xdr_stream *xdr, const nfs_fh4 value)
{
return xdr_stream_encode_opaque(xdr, value.data, value.len) >= 0;
}
static bool __maybe_unused
xdrgen_encode_utf8string(struct xdr_stream *xdr, const utf8string value)
{
return xdr_stream_encode_opaque(xdr, value.data, value.len) >= 0;
}
static bool __maybe_unused
xdrgen_encode_utf8str_cis(struct xdr_stream *xdr, const utf8str_cis value)
{
return xdrgen_encode_utf8string(xdr, value);
}
static bool __maybe_unused
xdrgen_encode_utf8str_cs(struct xdr_stream *xdr, const utf8str_cs value)
{
return xdrgen_encode_utf8string(xdr, value);
}
static bool __maybe_unused
xdrgen_encode_utf8str_mixed(struct xdr_stream *xdr, const utf8str_mixed value)
{
return xdrgen_encode_utf8string(xdr, value);
}
static bool __maybe_unused
xdrgen_encode_component4(struct xdr_stream *xdr, const component4 value)
{
return xdrgen_encode_utf8str_cs(xdr, value);
}
static bool __maybe_unused
xdrgen_encode_linktext4(struct xdr_stream *xdr, const linktext4 value)
{
return xdrgen_encode_utf8str_cs(xdr, value);
}
static bool __maybe_unused
xdrgen_encode_pathname4(struct xdr_stream *xdr, const pathname4 value)
{
if (xdr_stream_encode_u32(xdr, value.count) != XDR_UNIT)
return false;
for (u32 i = 0; i < value.count; i++)
if (!xdrgen_encode_component4(xdr, value.element[i]))
return false;
return true;
}
static bool __maybe_unused
xdrgen_encode_nfstime4(struct xdr_stream *xdr, const struct nfstime4 *value)
{
if (!xdrgen_encode_int64_t(xdr, value->seconds))
return false;
if (!xdrgen_encode_uint32_t(xdr, value->nseconds))
return false;
return true;
}
static bool __maybe_unused
xdrgen_encode_fattr4(struct xdr_stream *xdr, const struct fattr4 *value)
{
if (!xdrgen_encode_bitmap4(xdr, value->attrmask))
return false;
if (!xdrgen_encode_attrlist4(xdr, value->attr_vals))
return false;
return true;
}
static bool __maybe_unused
xdrgen_encode_stateid4(struct xdr_stream *xdr, const struct stateid4 *value)
{
if (!xdrgen_encode_uint32_t(xdr, value->seqid))
return false;
if (xdr_stream_encode_opaque_fixed(xdr, value->other, 12) < 0)
return false;
return true;
}
static bool __maybe_unused
xdrgen_encode_fattr4_offline(struct xdr_stream *xdr, const fattr4_offline value)
{
return xdrgen_encode_bool(xdr, value);
}
static bool __maybe_unused
xdrgen_encode_open_arguments4(struct xdr_stream *xdr, const struct open_arguments4 *value)
{
if (!xdrgen_encode_bitmap4(xdr, value->oa_share_access))
return false;
if (!xdrgen_encode_bitmap4(xdr, value->oa_share_deny))
return false;
if (!xdrgen_encode_bitmap4(xdr, value->oa_share_access_want))
return false;
if (!xdrgen_encode_bitmap4(xdr, value->oa_open_claim))
return false;
if (!xdrgen_encode_bitmap4(xdr, value->oa_create_mode))
return false;
return true;
}
static bool __maybe_unused
xdrgen_encode_open_args_share_access4(struct xdr_stream *xdr, open_args_share_access4 value)
{
return xdr_stream_encode_u32(xdr, value) == XDR_UNIT;
}
static bool __maybe_unused
xdrgen_encode_open_args_share_deny4(struct xdr_stream *xdr, open_args_share_deny4 value)
{
return xdr_stream_encode_u32(xdr, value) == XDR_UNIT;
}
static bool __maybe_unused
xdrgen_encode_open_args_share_access_want4(struct xdr_stream *xdr, open_args_share_access_want4 value)
{
return xdr_stream_encode_u32(xdr, value) == XDR_UNIT;
}
static bool __maybe_unused
xdrgen_encode_open_args_open_claim4(struct xdr_stream *xdr, open_args_open_claim4 value)
{
return xdr_stream_encode_u32(xdr, value) == XDR_UNIT;
}
static bool __maybe_unused
xdrgen_encode_open_args_createmode4(struct xdr_stream *xdr, open_args_createmode4 value)
{
return xdr_stream_encode_u32(xdr, value) == XDR_UNIT;
}
bool
xdrgen_encode_fattr4_open_arguments(struct xdr_stream *xdr, const fattr4_open_arguments *value)
{
return xdrgen_encode_open_arguments4(xdr, value);
}
bool
xdrgen_encode_fattr4_time_deleg_access(struct xdr_stream *xdr, const fattr4_time_deleg_access *value)
{
return xdrgen_encode_nfstime4(xdr, value);
}
bool
xdrgen_encode_fattr4_time_deleg_modify(struct xdr_stream *xdr, const fattr4_time_deleg_modify *value)
{
return xdrgen_encode_nfstime4(xdr, value);
}
static bool __maybe_unused
xdrgen_encode_open_delegation_type4(struct xdr_stream *xdr, open_delegation_type4 value)
{
return xdr_stream_encode_u32(xdr, value) == XDR_UNIT;
}
bool
xdrgen_encode_aclmodel4(struct xdr_stream *xdr, aclmodel4 value)
{
return xdr_stream_encode_u32(xdr, value) == XDR_UNIT;
}
bool
xdrgen_encode_aclscope4(struct xdr_stream *xdr, aclscope4 value)
{
return xdr_stream_encode_u32(xdr, value) == XDR_UNIT;
}
bool
xdrgen_encode_posixacetag4(struct xdr_stream *xdr, posixacetag4 value)
{
return xdr_stream_encode_u32(xdr, value) == XDR_UNIT;
}
bool
xdrgen_encode_posixaceperm4(struct xdr_stream *xdr, const posixaceperm4 value)
{
return xdrgen_encode_uint32_t(xdr, value);
}
static bool __maybe_unused
xdrgen_encode_posixace4(struct xdr_stream *xdr, const struct posixace4 *value)
{
if (!xdrgen_encode_posixacetag4(xdr, value->tag))
return false;
if (!xdrgen_encode_posixaceperm4(xdr, value->perm))
return false;
if (!xdrgen_encode_utf8str_mixed(xdr, value->who))
return false;
return true;
}
static bool __maybe_unused
xdrgen_encode_fattr4_acl_trueform(struct xdr_stream *xdr, const fattr4_acl_trueform value)
{
return xdrgen_encode_aclmodel4(xdr, value);
}
static bool __maybe_unused
xdrgen_encode_fattr4_acl_trueform_scope(struct xdr_stream *xdr, const fattr4_acl_trueform_scope value)
{
return xdrgen_encode_aclscope4(xdr, value);
}
static bool __maybe_unused
xdrgen_encode_fattr4_posix_default_acl(struct xdr_stream *xdr, const fattr4_posix_default_acl value)
{
if (xdr_stream_encode_u32(xdr, value.count) != XDR_UNIT)
return false;
for (u32 i = 0; i < value.count; i++)
if (!xdrgen_encode_posixace4(xdr, &value.element[i]))
return false;
return true;
}
static bool __maybe_unused
xdrgen_encode_fattr4_posix_access_acl(struct xdr_stream *xdr, const fattr4_posix_access_acl value)
{
if (xdr_stream_encode_u32(xdr, value.count) != XDR_UNIT)
return false;
for (u32 i = 0; i < value.count; i++)
if (!xdrgen_encode_posixace4(xdr, &value.element[i]))
return false;
return true;
}
static bool __maybe_unused
xdrgen_encode_notify_type4(struct xdr_stream *xdr, notify_type4 value)
{
return xdr_stream_encode_u32(xdr, value) == XDR_UNIT;
}
static bool __maybe_unused
xdrgen_encode_notify_entry4(struct xdr_stream *xdr, const struct notify_entry4 *value)
{
if (!xdrgen_encode_component4(xdr, value->ne_file))
return false;
if (!xdrgen_encode_fattr4(xdr, &value->ne_attrs))
return false;
return true;
}
static bool __maybe_unused
xdrgen_encode_prev_entry4(struct xdr_stream *xdr, const struct prev_entry4 *value)
{
if (!xdrgen_encode_notify_entry4(xdr, &value->pe_prev_entry))
return false;
if (!xdrgen_encode_nfs_cookie4(xdr, value->pe_prev_entry_cookie))
return false;
return true;
}
bool
xdrgen_encode_notify_remove4(struct xdr_stream *xdr, const struct notify_remove4 *value)
{
if (!xdrgen_encode_notify_entry4(xdr, &value->nrm_old_entry))
return false;
if (!xdrgen_encode_nfs_cookie4(xdr, value->nrm_old_entry_cookie))
return false;
return true;
}
bool
xdrgen_encode_notify_add4(struct xdr_stream *xdr, const struct notify_add4 *value)
{
if (value->nad_old_entry.count > 1)
return false;
if (xdr_stream_encode_u32(xdr, value->nad_old_entry.count) != XDR_UNIT)
return false;
for (u32 i = 0; i < value->nad_old_entry.count; i++)
if (!xdrgen_encode_notify_remove4(xdr, &value->nad_old_entry.element[i]))
return false;
if (!xdrgen_encode_notify_entry4(xdr, &value->nad_new_entry))
return false;
if (value->nad_new_entry_cookie.count > 1)
return false;
if (xdr_stream_encode_u32(xdr, value->nad_new_entry_cookie.count) != XDR_UNIT)
return false;
for (u32 i = 0; i < value->nad_new_entry_cookie.count; i++)
if (!xdrgen_encode_nfs_cookie4(xdr, value->nad_new_entry_cookie.element[i]))
return false;
if (value->nad_prev_entry.count > 1)
return false;
if (xdr_stream_encode_u32(xdr, value->nad_prev_entry.count) != XDR_UNIT)
return false;
for (u32 i = 0; i < value->nad_prev_entry.count; i++)
if (!xdrgen_encode_prev_entry4(xdr, &value->nad_prev_entry.element[i]))
return false;
if (!xdrgen_encode_bool(xdr, value->nad_last_entry))
return false;
return true;
}
bool
xdrgen_encode_notify_attr4(struct xdr_stream *xdr, const struct notify_attr4 *value)
{
if (!xdrgen_encode_notify_entry4(xdr, &value->na_changed_entry))
return false;
return true;
}
bool
xdrgen_encode_notify_rename4(struct xdr_stream *xdr, const struct notify_rename4 *value)
{
if (!xdrgen_encode_notify_remove4(xdr, &value->nrn_old_entry))
return false;
if (!xdrgen_encode_notify_add4(xdr, &value->nrn_new_entry))
return false;
return true;
}
static bool __maybe_unused
xdrgen_encode_notify_verifier4(struct xdr_stream *xdr, const struct notify_verifier4 *value)
{
if (!xdrgen_encode_verifier4(xdr, value->nv_old_cookieverf))
return false;
if (!xdrgen_encode_verifier4(xdr, value->nv_new_cookieverf))
return false;
return true;
}
static bool __maybe_unused
xdrgen_encode_notifylist4(struct xdr_stream *xdr, const notifylist4 value)
{
return xdr_stream_encode_opaque(xdr, value.data, value.len) >= 0;
}
static bool __maybe_unused
xdrgen_encode_notify4(struct xdr_stream *xdr, const struct notify4 *value)
{
if (!xdrgen_encode_bitmap4(xdr, value->notify_mask))
return false;
if (!xdrgen_encode_notifylist4(xdr, value->notify_vals))
return false;
return true;
}
bool
xdrgen_encode_CB_NOTIFY4args(struct xdr_stream *xdr, const struct CB_NOTIFY4args *value)
{
if (!xdrgen_encode_stateid4(xdr, &value->cna_stateid))
return false;
if (!xdrgen_encode_nfs_fh4(xdr, value->cna_fh))
return false;
if (xdr_stream_encode_u32(xdr, value->cna_changes.count) != XDR_UNIT)
return false;
for (u32 i = 0; i < value->cna_changes.count; i++)
if (!xdrgen_encode_notify4(xdr, &value->cna_changes.element[i]))
return false;
return true;
}
static bool __maybe_unused
xdrgen_encode_CB_NOTIFY4res(struct xdr_stream *xdr, const struct CB_NOTIFY4res *value)
{
if (!xdrgen_encode_nfsstat4(xdr, value->cnr_status))
return false;
return true;
}