ReactOS 0.4.16-dev-122-g325d74c
nfs41_xdr.c File Reference
#include <windows.h>
#include <strsafe.h>
#include "nfs41_compound.h"
#include "nfs41_ops.h"
#include "nfs41_xdr.h"
#include "util.h"
#include "daemon_debug.h"
#include "rpc/rpc.h"
Include dependency graph for nfs41_xdr.c:

Go to the source code of this file.

Classes

struct  __readdir_entry_iterator
 
struct  __op_table_entry
 

Typedefs

typedef struct __readdir_entry_iterator readdir_entry_iterator
 
typedef bool_t(* nfs_op_encode_proc) (XDR *, nfs_argop4 *)
 
typedef bool_t(* nfs_op_decode_proc) (XDR *, nfs_resop4 *)
 
typedef struct __op_table_entry op_table_entry
 

Enumerations

enum  limit_by4 { NFS_LIMIT_SIZE = 1 , NFS_LIMIT_BLOCKS = 2 }
 

Functions

static bool_t encode_file_attrs (fattr4 *attrs, nfs41_file_info *info)
 
static __inline int unexpected_op (uint32_t op, uint32_t expected)
 
bool_t xdr_bitmap4 (XDR *xdr, bitmap4 *bitmap)
 
static bool_t xdr_nfstime4 (XDR *xdr, nfstime4 *nt)
 
static uint32_t settime_how (nfstime4 *newtime, const nfstime4 *time_delta)
 
static bool_t xdr_settime4 (XDR *xdr, nfstime4 *nt, const nfstime4 *time_delta)
 
static bool_t xdr_stateid4 (XDR *xdr, stateid4 *si)
 
bool_t xdr_fattr4 (XDR *xdr, fattr4 *fattr)
 
static bool_t xdr_fh (XDR *xdr, nfs41_fh *fh)
 
static bool_t xdr_fsid (XDR *xdr, nfs41_fsid *fsid)
 
static bool_t encode_component (XDR *xdr, const nfs41_component *component)
 
static bool_t decode_component (XDR *xdr, nfs41_component *component)
 
static bool_t xdr_state_owner4 (XDR *xdr, state_owner4 *so)
 
static bool_t xdr_layout_types (XDR *xdr, uint32_t *layout_type)
 
static bool_t xdr_threshold_item (XDR *xdr, threshold_item4 *item)
 
static bool_t xdr_mdsthreshold (XDR *xdr, mdsthreshold4 *mdsthreshold)
 
static bool_t xdr_nfsace4 (XDR *xdr, nfsace4 *ace)
 
static bool_t xdr_nfsdacl41 (XDR *xdr, nfsacl41 *acl)
 
static bool_t xdr_nfsacl41 (XDR *xdr, nfsacl41 *acl)
 
void nfsacl41_free (nfsacl41 *acl)
 
static bool_t decode_pathname4 (XDR *xdr, nfs41_abs_path *path)
 
static bool_t decode_fs_location4 (XDR *xdr, fs_location4 *location)
 
static bool_t decode_fs_locations4 (XDR *xdr, fs_locations4 *locations)
 
static bool_t xdr_client_owner4 (XDR *xdr, client_owner4 *co)
 
static bool_t xdr_state_protect4_a (XDR *xdr, state_protect4_a *spa)
 
static bool_t xdr_nfs_impl_id4 (XDR *xdr, nfs_impl_id4 *nii)
 
static bool_t encode_op_exchange_id (XDR *xdr, nfs_argop4 *argop)
 
static bool_t xdr_state_protect4_r (XDR *xdr, state_protect4_r *spr)
 
static bool_t xdr_server_owner4 (XDR *xdr, server_owner4 *so)
 
static bool_t decode_op_exchange_id (XDR *xdr, nfs_resop4 *resop)
 
static bool_t xdr_channel_attrs4 (XDR *xdr, nfs41_channel_attrs *attrs)
 
static bool_t encode_backchannel_sec_parms (XDR *xdr, nfs41_callback_secparms *args)
 
static bool_t encode_op_create_session (XDR *xdr, nfs_argop4 *argop)
 
static bool_t decode_op_create_session (XDR *xdr, nfs_resop4 *resop)
 
static bool_t encode_op_bind_conn_to_session (XDR *xdr, nfs_argop4 *argop)
 
static bool_t decode_op_bind_conn_to_session (XDR *xdr, nfs_resop4 *resop)
 
static bool_t encode_op_destroy_session (XDR *xdr, nfs_argop4 *argop)
 
static bool_t decode_op_destroy_session (XDR *xdr, nfs_resop4 *resop)
 
static bool_t encode_op_destroy_clientid (XDR *xdr, nfs_argop4 *argop)
 
static bool_t decode_op_destroy_clientid (XDR *xdr, nfs_resop4 *resop)
 
static bool_t encode_op_sequence (XDR *xdr, nfs_argop4 *argop)
 
static bool_t xdr_sequence_res_ok (XDR *xdr, nfs41_sequence_res_ok *res)
 
static bool_t decode_op_sequence (XDR *xdr, nfs_resop4 *resop)
 
static bool_t encode_op_reclaim_complete (XDR *xdr, nfs_argop4 *argop)
 
static bool_t decode_op_reclaim_complete (XDR *xdr, nfs_resop4 *resop)
 
static bool_t encode_op_putfh (XDR *xdr, nfs_argop4 *argop)
 
static bool_t decode_op_putfh (XDR *xdr, nfs_resop4 *resop)
 
static bool_t encode_op_putrootfh (XDR *xdr, nfs_argop4 *argop)
 
static bool_t decode_op_putrootfh (XDR *xdr, nfs_resop4 *resop)
 
static bool_t encode_op_getfh (XDR *xdr, nfs_argop4 *argop)
 
static bool_t decode_op_getfh (XDR *xdr, nfs_resop4 *resop)
 
static bool_t encode_op_lookup (XDR *xdr, nfs_argop4 *argop)
 
static bool_t decode_op_lookup (XDR *xdr, nfs_resop4 *resop)
 
static bool_t encode_op_access (XDR *xdr, nfs_argop4 *argop)
 
static bool_t decode_op_access (XDR *xdr, nfs_resop4 *resop)
 
static bool_t encode_op_close (XDR *xdr, nfs_argop4 *argop)
 
static bool_t decode_op_close (XDR *xdr, nfs_resop4 *resop)
 
static bool_t encode_op_commit (XDR *xdr, nfs_argop4 *argop)
 
static bool_t decode_op_commit (XDR *xdr, nfs_resop4 *resop)
 
static bool_t encode_createtype4 (XDR *xdr, createtype4 *ct)
 
static bool_t encode_createattrs4 (XDR *xdr, nfs41_file_info *createattrs)
 
static bool_t encode_op_create (XDR *xdr, nfs_argop4 *argop)
 
static bool_t xdr_change_info4 (XDR *xdr, change_info4 *cinfo)
 
static bool_t decode_op_create (XDR *xdr, nfs_resop4 *resop)
 
static bool_t encode_op_link (XDR *xdr, nfs_argop4 *argop)
 
static bool_t decode_op_link (XDR *xdr, nfs_resop4 *resop)
 
static bool_t xdr_locker4 (XDR *xdr, locker4 *locker)
 
static bool_t encode_op_lock (XDR *xdr, nfs_argop4 *argop)
 
static bool_t decode_lock_res_denied (XDR *xdr, lock_res_denied *denied)
 
static bool_t decode_op_lock (XDR *xdr, nfs_resop4 *resop)
 
static bool_t encode_op_lockt (XDR *xdr, nfs_argop4 *argop)
 
static bool_t decode_op_lockt (XDR *xdr, nfs_resop4 *resop)
 
static bool_t encode_op_locku (XDR *xdr, nfs_argop4 *argop)
 
static bool_t decode_op_locku (XDR *xdr, nfs_resop4 *resop)
 
static bool_t encode_op_delegpurge (XDR *xdr, nfs_argop4 *argop)
 
static bool_t decode_op_delegpurge (XDR *xdr, nfs_resop4 *resop)
 
static bool_t encode_op_delegreturn (XDR *xdr, nfs_argop4 *argop)
 
static bool_t decode_op_delegreturn (XDR *xdr, nfs_resop4 *resop)
 
static bool_t encode_op_getattr (XDR *xdr, nfs_argop4 *argop)
 
static bool_t decode_file_attrs (XDR *xdr, fattr4 *attrs, nfs41_file_info *info)
 
static bool_t decode_op_getattr (XDR *xdr, nfs_resop4 *resop)
 
static bool_t encode_createhow4 (XDR *xdr, createhow4 *ch)
 
static bool_t encode_openflag4 (XDR *xdr, openflag4 *of)
 
static bool_t encode_claim_deleg_cur (XDR *xdr, stateid4 *stateid, nfs41_component *name)
 
static bool_t encode_open_claim4 (XDR *xdr, open_claim4 *oc)
 
static bool_t encode_op_open (XDR *xdr, nfs_argop4 *argop)
 
static bool_t decode_open_none_delegation4 (XDR *xdr, open_delegation4 *delegation)
 
static bool_t decode_open_read_delegation4 (XDR *xdr, open_delegation4 *delegation)
 
static bool_t decode_modified_limit4 (XDR *xdr, uint64_t *filesize)
 
static bool_t decode_space_limit4 (XDR *xdr, uint64_t *filesize)
 
static bool_t decode_open_write_delegation4 (XDR *xdr, open_delegation4 *delegation)
 
static bool_t decode_open_res_ok (XDR *xdr, nfs41_op_open_res_ok *res)
 
static bool_t decode_op_open (XDR *xdr, nfs_resop4 *resop)
 
static bool_t encode_op_openattr (XDR *xdr, nfs_argop4 *argop)
 
static bool_t decode_op_openattr (XDR *xdr, nfs_resop4 *resop)
 
static bool_t encode_op_read (XDR *xdr, nfs_argop4 *argop)
 
static bool_t decode_read_res_ok (XDR *xdr, nfs41_read_res_ok *res)
 
static bool_t decode_op_read (XDR *xdr, nfs_resop4 *resop)
 
static bool_t encode_op_readdir (XDR *xdr, nfs_argop4 *argop)
 
static bool_t decode_readdir_entry (XDR *xdr, readdir_entry_iterator *it)
 
static bool_t decode_readdir_list (XDR *xdr, nfs41_readdir_list *dirs)
 
static bool_t decode_op_readdir (XDR *xdr, nfs_resop4 *resop)
 
static bool_t encode_op_readlink (XDR *xdr, nfs_argop4 *argop)
 
static bool_t decode_op_readlink (XDR *xdr, nfs_resop4 *resop)
 
static bool_t encode_op_remove (XDR *xdr, nfs_argop4 *argop)
 
static bool_t decode_op_remove (XDR *xdr, nfs_resop4 *resop)
 
static bool_t encode_op_rename (XDR *xdr, nfs_argop4 *argop)
 
static bool_t decode_op_rename (XDR *xdr, nfs_resop4 *resop)
 
static bool_t encode_op_restorefh (XDR *xdr, nfs_argop4 *argop)
 
static bool_t decode_op_restorefh (XDR *xdr, nfs_resop4 *resop)
 
static bool_t encode_op_savefh (XDR *xdr, nfs_argop4 *argop)
 
static bool_t decode_op_savefh (XDR *xdr, nfs_resop4 *resop)
 
static bool_t encode_op_setattr (XDR *xdr, nfs_argop4 *argop)
 
static bool_t decode_op_setattr (XDR *xdr, nfs_resop4 *resop)
 
static bool_t encode_op_want_delegation (XDR *xdr, nfs_argop4 *argop)
 
static bool_t decode_op_want_delegation (XDR *xdr, nfs_resop4 *resop)
 
static bool_t encode_op_free_stateid (XDR *xdr, nfs_argop4 *argop)
 
static bool_t decode_op_free_stateid (XDR *xdr, nfs_resop4 *resop)
 
static bool_t encode_op_test_stateid (XDR *xdr, nfs_argop4 *argop)
 
static bool_t decode_op_test_stateid (XDR *xdr, nfs_resop4 *resop)
 
static bool_t encode_op_write (XDR *xdr, nfs_argop4 *argop)
 
static bool_t xdr_write_verf (XDR *xdr, nfs41_write_verf *verf)
 
static bool_t xdr_write_res_ok (XDR *xdr, nfs41_write_res_ok *res)
 
static bool_t decode_op_write (XDR *xdr, nfs_resop4 *resop)
 
static bool_t xdr_secinfo (XDR *xdr, nfs41_secinfo_info *secinfo)
 
static bool_t encode_op_secinfo_noname (XDR *xdr, nfs_argop4 *argop)
 
static bool_t decode_op_secinfo_noname (XDR *xdr, nfs_resop4 *resop)
 
static bool_t encode_op_secinfo (XDR *xdr, nfs_argop4 *argop)
 
static bool_t decode_op_secinfo (XDR *xdr, nfs_resop4 *resop)
 
static bool_t encode_op_getdeviceinfo (XDR *xdr, nfs_argop4 *argop)
 
static bool_t xdr_stripe_indices (XDR *xdr, pnfs_stripe_indices *indices)
 
static bool_t xdr_pnfs_addr (XDR *xdr, netaddr4 *addr)
 
static bool_t xdr_multi_addr (XDR *xdr, multi_addr4 *list)
 
static bool_t xdr_data_server_list (XDR *xdr, pnfs_data_server_list *servers)
 
static bool_t xdr_file_device (XDR *xdr, pnfs_file_device *device)
 
static bool_t decode_getdeviceinfo_ok (XDR *xdr, pnfs_getdeviceinfo_res_ok *res_ok)
 
static bool_t decode_op_getdeviceinfo (XDR *xdr, nfs_resop4 *resop)
 
static bool_t encode_op_layoutcommit (XDR *xdr, nfs_argop4 *argop)
 
static bool_t decode_op_layoutcommit (XDR *xdr, nfs_resop4 *resop)
 
static bool_t encode_op_layoutget (XDR *xdr, nfs_argop4 *argop)
 
static bool_t decode_file_layout_handles (XDR *xdr, pnfs_file_layout_handles *handles)
 
static bool_t decode_file_layout (XDR *xdr, struct list_entry *list, pnfs_layout *base)
 
static bool_t decode_layout (XDR *xdr, struct list_entry *list)
 
static bool_t decode_layout_res_ok (XDR *xdr, pnfs_layoutget_res_ok *res)
 
static bool_t decode_op_layoutget (XDR *xdr, nfs_resop4 *resop)
 
static bool_t encode_op_layoutreturn (XDR *xdr, nfs_argop4 *argop)
 
static bool_t decode_op_layoutreturn (XDR *xdr, nfs_resop4 *resop)
 
static const op_table_entryop_table_find (uint32_t op)
 
bool_t nfs_encode_compound (XDR *xdr, caddr_t *pargs)
 
bool_t nfs_decode_compound (XDR *xdr, caddr_t *pres)
 

Variables

static const op_table_entry g_op_table []
 
static const uint32_t g_op_table_size = ARRAYSIZE(g_op_table)
 

Typedef Documentation

◆ nfs_op_decode_proc

typedef bool_t(* nfs_op_decode_proc) (XDR *, nfs_resop4 *)

Definition at line 3507 of file nfs41_xdr.c.

◆ nfs_op_encode_proc

typedef bool_t(* nfs_op_encode_proc) (XDR *, nfs_argop4 *)

Definition at line 3506 of file nfs41_xdr.c.

◆ op_table_entry

◆ readdir_entry_iterator

Enumeration Type Documentation

◆ limit_by4

Enumerator
NFS_LIMIT_SIZE 
NFS_LIMIT_BLOCKS 

Definition at line 2069 of file nfs41_xdr.c.

2069 {
2070 NFS_LIMIT_SIZE = 1,
2072};
@ NFS_LIMIT_SIZE
Definition: nfs41_xdr.c:2070
@ NFS_LIMIT_BLOCKS
Definition: nfs41_xdr.c:2071

Function Documentation

◆ decode_component()

static bool_t decode_component ( XDR xdr,
nfs41_component component 
)
static

Definition at line 186 of file nfs41_xdr.c.

189{
192
193 result = xdr_bytes(xdr, (char **)&component->name, &len, NFS4_OPAQUE_LIMIT);
194 component->len = (result == FALSE) ? 0 : (unsigned short)len;
195 return result;
196}
bool_t xdr_bytes(XDR *xdrs, char **cpp, u_int *sizep, u_int maxsize)
Definition: xdr.c:536
int32_t bool_t
Definition: types.h:101
#define FALSE
Definition: types.h:117
UINT32 uint32_t
Definition: types.h:75
GLenum GLsizei len
Definition: glext.h:6722
GLuint64EXT * result
Definition: glext.h:11304
#define NFS4_OPAQUE_LIMIT
Definition: nfs41_const.h:31
const char * name
Definition: nfs41_types.h:48
unsigned short len
Definition: nfs41_types.h:49

◆ decode_file_attrs()

static bool_t decode_file_attrs ( XDR xdr,
fattr4 attrs,
nfs41_file_info info 
)
static

Definition at line 1706 of file nfs41_xdr.c.

1710{
1711 if (attrs->attrmask.count >= 1) {
1712 if (attrs->attrmask.arr[0] & FATTR4_WORD0_SUPPORTED_ATTRS) {
1713 if (!xdr_bitmap4(xdr, info->supported_attrs))
1714 return FALSE;
1715 }
1716 if (attrs->attrmask.arr[0] & FATTR4_WORD0_TYPE) {
1717 if (!xdr_u_int32_t(xdr, &info->type))
1718 return FALSE;
1719 }
1720 if (attrs->attrmask.arr[0] & FATTR4_WORD0_CHANGE) {
1721 if (!xdr_u_hyper(xdr, &info->change))
1722 return FALSE;
1723 }
1724 if (attrs->attrmask.arr[0] & FATTR4_WORD0_SIZE) {
1725 if (!xdr_u_hyper(xdr, &info->size))
1726 return FALSE;
1727 }
1728 if (attrs->attrmask.arr[0] & FATTR4_WORD0_LINK_SUPPORT) {
1729 if (!xdr_bool(xdr, &info->link_support))
1730 return FALSE;
1731 }
1732 if (attrs->attrmask.arr[0] & FATTR4_WORD0_SYMLINK_SUPPORT) {
1733 if (!xdr_bool(xdr, &info->symlink_support))
1734 return FALSE;
1735 }
1736 if (attrs->attrmask.arr[0] & FATTR4_WORD0_FSID) {
1737 if (!xdr_fsid(xdr, &info->fsid))
1738 return FALSE;
1739 }
1740 if (attrs->attrmask.arr[0] & FATTR4_WORD0_LEASE_TIME) {
1741 if (!xdr_u_int32_t(xdr, &info->lease_time))
1742 return FALSE;
1743 }
1744 if (attrs->attrmask.arr[0] & FATTR4_WORD0_RDATTR_ERROR) {
1745 if (!xdr_u_int32_t(xdr, &info->rdattr_error))
1746 return FALSE;
1747 }
1748 if (attrs->attrmask.arr[0] & FATTR4_WORD0_ACL) {
1749 nfsacl41 *acl = info->acl;
1750 if (!xdr_array(xdr, (char**)&acl->aces, &acl->count,
1751 32, sizeof(nfsace4), (xdrproc_t)xdr_nfsace4))
1752 return FALSE;
1753 }
1754 if (attrs->attrmask.arr[0] & FATTR4_WORD0_ACLSUPPORT) {
1755 if (!xdr_u_int32_t(xdr, &info->aclsupport))
1756 return FALSE;
1757 }
1758 if (attrs->attrmask.arr[0] & FATTR4_WORD0_ARCHIVE) {
1759 if (!xdr_bool(xdr, &info->archive))
1760 return FALSE;
1761 }
1762 if (attrs->attrmask.arr[0] & FATTR4_WORD0_CANSETTIME) {
1763 if (!xdr_bool(xdr, &info->cansettime))
1764 return FALSE;
1765 }
1766 if (attrs->attrmask.arr[0] & FATTR4_WORD0_CASE_INSENSITIVE) {
1767 if (!xdr_bool(xdr, &info->case_insensitive))
1768 return FALSE;
1769 }
1770 if (attrs->attrmask.arr[0] & FATTR4_WORD0_CASE_PRESERVING) {
1771 if (!xdr_bool(xdr, &info->case_preserving))
1772 return FALSE;
1773 }
1774 if (attrs->attrmask.arr[0] & FATTR4_WORD0_FILEID) {
1775 if (!xdr_u_hyper(xdr, &info->fileid))
1776 return FALSE;
1777 }
1778 if (attrs->attrmask.arr[0] & FATTR4_WORD0_FS_LOCATIONS) {
1779 if (!decode_fs_locations4(xdr, info->fs_locations))
1780 return FALSE;
1781 }
1782 if (attrs->attrmask.arr[0] & FATTR4_WORD0_HIDDEN) {
1783 if (!xdr_bool(xdr, &info->hidden))
1784 return FALSE;
1785 }
1786 if (attrs->attrmask.arr[0] & FATTR4_WORD0_MAXREAD) {
1787 if (!xdr_u_hyper(xdr, &info->maxread))
1788 return FALSE;
1789 }
1790 if (attrs->attrmask.arr[0] & FATTR4_WORD0_MAXWRITE) {
1791 if (!xdr_u_hyper(xdr, &info->maxwrite))
1792 return FALSE;
1793 }
1794 }
1795 if (attrs->attrmask.count >= 2) {
1796 if (attrs->attrmask.arr[1] & FATTR4_WORD1_MODE) {
1797 if (!xdr_u_int32_t(xdr, &info->mode))
1798 return FALSE;
1799 }
1800 if (attrs->attrmask.arr[1] & FATTR4_WORD1_NUMLINKS) {
1801 if (!xdr_u_int32_t(xdr, &info->numlinks))
1802 return FALSE;
1803 }
1804 if (attrs->attrmask.arr[1] & FATTR4_WORD1_OWNER) {
1805 char *ptr = &info->owner[0];
1806 uint32_t owner_len;
1807 if (!xdr_bytes(xdr, &ptr, &owner_len,
1809 return FALSE;
1810 info->owner[owner_len] = '\0';
1811 }
1812 if (attrs->attrmask.arr[1] & FATTR4_WORD1_OWNER_GROUP) {
1813 char *ptr = &info->owner_group[0];
1814 uint32_t owner_group_len;
1815 if (!xdr_bytes(xdr, &ptr, &owner_group_len,
1817 return FALSE;
1818 info->owner_group[owner_group_len] = '\0';
1819 }
1820 if (attrs->attrmask.arr[1] & FATTR4_WORD1_SPACE_AVAIL) {
1821 if (!xdr_u_hyper(xdr, &info->space_avail))
1822 return FALSE;
1823 }
1824 if (attrs->attrmask.arr[1] & FATTR4_WORD1_SPACE_FREE) {
1825 if (!xdr_u_hyper(xdr, &info->space_free))
1826 return FALSE;
1827 }
1828 if (attrs->attrmask.arr[1] & FATTR4_WORD1_SPACE_TOTAL) {
1829 if (!xdr_u_hyper(xdr, &info->space_total))
1830 return FALSE;
1831 }
1832 if (attrs->attrmask.arr[1] & FATTR4_WORD1_SYSTEM) {
1833 if (!xdr_bool(xdr, &info->system))
1834 return FALSE;
1835 }
1836 if (attrs->attrmask.arr[1] & FATTR4_WORD1_TIME_ACCESS) {
1837 if (!xdr_nfstime4(xdr, &info->time_access))
1838 return FALSE;
1839 }
1840 if (attrs->attrmask.arr[1] & FATTR4_WORD1_TIME_CREATE) {
1841 if (!xdr_nfstime4(xdr, &info->time_create))
1842 return FALSE;
1843 }
1844 if (attrs->attrmask.arr[1] & FATTR4_WORD1_TIME_DELTA) {
1845 if (!xdr_nfstime4(xdr, info->time_delta))
1846 return FALSE;
1847 }
1848 if (attrs->attrmask.arr[1] & FATTR4_WORD1_TIME_MODIFY) {
1849 if (!xdr_nfstime4(xdr, &info->time_modify))
1850 return FALSE;
1851 }
1852 if (attrs->attrmask.arr[1] & FATTR4_WORD1_DACL) {
1853 if (!xdr_nfsdacl41(xdr, info->acl))
1854 return FALSE;
1855 }
1856 if (attrs->attrmask.arr[1] & FATTR4_WORD1_FS_LAYOUT_TYPE) {
1857 if (!xdr_layout_types(xdr, &info->fs_layout_types))
1858 return FALSE;
1859 }
1860 }
1861 if (attrs->attrmask.count >= 3) {
1862 if (attrs->attrmask.arr[2] & FATTR4_WORD2_MDSTHRESHOLD) {
1863 if (!xdr_mdsthreshold(xdr, &info->mdsthreshold))
1864 return FALSE;
1865 }
1867 if (!xdr_bitmap4(xdr, info->suppattr_exclcreat))
1868 return FALSE;
1869 }
1870 }
1871 return TRUE;
1872}
bool_t xdr_bool(XDR *xdrs, bool_t *bp)
Definition: xdr.c:428
bool_t xdr_u_int32_t(XDR *xdrs, u_int32_t *u_int32_p)
Definition: xdr.c:239
bool_t xdr_u_hyper(XDR *xdrs, u_longlong_t *ullp)
Definition: xdr.c:878
#define TRUE
Definition: types.h:120
static PVOID ptr
Definition: dispmode.c:27
@ FATTR4_WORD1_SPACE_FREE
Definition: nfs41_const.h:255
@ FATTR4_WORD0_HIDDEN
Definition: nfs41_const.h:237
@ FATTR4_WORD1_SPACE_AVAIL
Definition: nfs41_const.h:254
@ FATTR4_WORD1_TIME_DELTA
Definition: nfs41_const.h:263
@ FATTR4_WORD1_TIME_CREATE
Definition: nfs41_const.h:262
@ FATTR4_WORD1_MODE
Definition: nfs41_const.h:245
@ FATTR4_WORD1_TIME_MODIFY
Definition: nfs41_const.h:265
@ FATTR4_WORD1_SPACE_TOTAL
Definition: nfs41_const.h:256
@ FATTR4_WORD0_LEASE_TIME
Definition: nfs41_const.h:217
@ FATTR4_WORD1_OWNER_GROUP
Definition: nfs41_const.h:249
@ FATTR4_WORD0_LINK_SUPPORT
Definition: nfs41_const.h:212
@ FATTR4_WORD0_CANSETTIME
Definition: nfs41_const.h:228
@ FATTR4_WORD2_MDSTHRESHOLD
Definition: nfs41_const.h:280
@ FATTR4_WORD1_OWNER
Definition: nfs41_const.h:248
@ FATTR4_WORD0_CASE_PRESERVING
Definition: nfs41_const.h:230
@ FATTR4_WORD0_ARCHIVE
Definition: nfs41_const.h:227
@ FATTR4_WORD1_TIME_ACCESS
Definition: nfs41_const.h:259
@ FATTR4_WORD0_RDATTR_ERROR
Definition: nfs41_const.h:218
@ FATTR4_WORD0_MAXWRITE
Definition: nfs41_const.h:243
@ FATTR4_WORD0_ACLSUPPORT
Definition: nfs41_const.h:226
@ FATTR4_WORD0_SYMLINK_SUPPORT
Definition: nfs41_const.h:213
@ FATTR4_WORD0_TYPE
Definition: nfs41_const.h:208
@ FATTR4_WORD1_SYSTEM
Definition: nfs41_const.h:258
@ FATTR4_WORD0_CHANGE
Definition: nfs41_const.h:210
@ FATTR4_WORD0_FS_LOCATIONS
Definition: nfs41_const.h:236
@ FATTR4_WORD1_NUMLINKS
Definition: nfs41_const.h:247
@ FATTR4_WORD0_SUPPORTED_ATTRS
Definition: nfs41_const.h:207
@ FATTR4_WORD0_FILEID
Definition: nfs41_const.h:232
@ FATTR4_WORD2_SUPPATTR_EXCLCREAT
Definition: nfs41_const.h:220
@ FATTR4_WORD0_SIZE
Definition: nfs41_const.h:211
@ FATTR4_WORD1_FS_LAYOUT_TYPE
Definition: nfs41_const.h:274
@ FATTR4_WORD0_ACL
Definition: nfs41_const.h:225
@ FATTR4_WORD0_CASE_INSENSITIVE
Definition: nfs41_const.h:229
@ FATTR4_WORD0_FSID
Definition: nfs41_const.h:215
@ FATTR4_WORD0_MAXREAD
Definition: nfs41_const.h:242
@ FATTR4_WORD1_DACL
Definition: nfs41_const.h:270
static bool_t xdr_nfsdacl41(XDR *xdr, nfsacl41 *acl)
Definition: nfs41_xdr.c:316
static bool_t xdr_mdsthreshold(XDR *xdr, mdsthreshold4 *mdsthreshold)
Definition: nfs41_xdr.c:276
static bool_t xdr_nfsace4(XDR *xdr, nfsace4 *ace)
Definition: nfs41_xdr.c:294
static bool_t xdr_layout_types(XDR *xdr, uint32_t *layout_type)
Definition: nfs41_xdr.c:222
static bool_t xdr_nfstime4(XDR *xdr, nfstime4 *nt)
Definition: nfs41_xdr.c:86
static bool_t decode_fs_locations4(XDR *xdr, fs_locations4 *locations)
Definition: nfs41_xdr.c:419
static bool_t xdr_fsid(XDR *xdr, nfs41_fsid *fsid)
Definition: nfs41_xdr.c:166
bool_t xdr_bitmap4(XDR *xdr, bitmap4 *bitmap)
Definition: nfs41_xdr.c:48
uint32_t count
Definition: nfs41_types.h:96
uint32_t arr[3]
Definition: nfs41_types.h:97
bitmap4 attrmask
Definition: nfs41_types.h:160
nfsace4 * aces
Definition: nfs41_types.h:139
uint32_t count
Definition: nfs41_types.h:140
bool_t(* xdrproc_t)(XDR *,...)
Definition: xdr.h:144
bool_t xdr_array(XDR *xdrs, caddr_t *addrp, u_int *sizep, u_int maxsize, u_int elsize, xdrproc_t elproc)
Definition: xdr_array.c:61

Referenced by decode_op_getattr(), and decode_readdir_entry().

◆ decode_file_layout()

static bool_t decode_file_layout ( XDR xdr,
struct list_entry list,
pnfs_layout base 
)
static

Definition at line 3322 of file nfs41_xdr.c.

3326{
3328 u_int32_t len_ignored;
3329
3330 if (!xdr_u_int32_t(xdr, &len_ignored))
3331 return FALSE;
3332
3333 layout = calloc(1, sizeof(pnfs_file_layout));
3334 if (layout == NULL)
3335 return FALSE;
3336
3337 layout->layout.offset = base->offset;
3338 layout->layout.length = base->length;
3339 layout->layout.iomode = base->iomode;
3340 layout->layout.type = base->type;
3341 list_init(&layout->layout.entry);
3342
3343 if (!xdr_opaque(xdr, (char *)layout->deviceid, PNFS_DEVICEID_SIZE))
3344 goto out_error;
3345
3346 if (!xdr_u_int32_t(xdr, &layout->util))
3347 goto out_error;
3348
3349 if (!xdr_u_int32_t(xdr, &layout->first_index))
3350 goto out_error;
3351
3352 if (!xdr_u_hyper(xdr, &layout->pattern_offset))
3353 goto out_error;
3354
3355 if (!decode_file_layout_handles(xdr, &layout->filehandles))
3356 goto out_error;
3357
3358 list_add_tail(list, &layout->layout.entry);
3359 return TRUE;
3360
3361out_error:
3362 free(layout);
3363 return FALSE;
3364}
bool_t xdr_opaque(XDR *xdrs, caddr_t cp, u_int cnt)
Definition: xdr.c:484
static void list_add_tail(struct list_entry *head, struct list_entry *entry)
Definition: list.h:83
static void list_init(struct list_entry *head)
Definition: list.h:51
Definition: list.h:37
#define free
Definition: debug_ros.c:5
#define NULL
Definition: types.h:112
static DWORD layout
Definition: bitmap.c:46
static bool_t decode_file_layout_handles(XDR *xdr, pnfs_file_layout_handles *handles)
Definition: nfs41_xdr.c:3296
#define PNFS_DEVICEID_SIZE
Definition: pnfs.h:111
unsigned int u_int32_t
Definition: rosdhcp.h:35
#define calloc
Definition: rosglue.h:14

Referenced by decode_layout().

◆ decode_file_layout_handles()

static bool_t decode_file_layout_handles ( XDR xdr,
pnfs_file_layout_handles handles 
)
static

Definition at line 3296 of file nfs41_xdr.c.

3299{
3300 uint32_t i, count;
3301
3302 if (!xdr_u_int32_t(xdr, &count))
3303 return FALSE;
3304
3305 if (count && count != handles->count) {
3306 nfs41_path_fh *tmp;
3307 tmp = realloc(handles->arr, count * sizeof(nfs41_path_fh));
3308 if (tmp == NULL)
3309 return FALSE;
3310 handles->arr = tmp;
3311 ZeroMemory(handles->arr, count * sizeof(nfs41_path_fh));
3312 handles->count = count;
3313 }
3314
3315 for (i = 0; i < handles->count; i++) {
3316 if (!xdr_fh(xdr, &handles->arr[i].fh))
3317 return FALSE;
3318 }
3319 return TRUE;
3320}
#define realloc
Definition: debug_ros.c:6
GLuint GLuint GLsizei count
Definition: gl.h:1545
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
static bool_t xdr_fh(XDR *xdr, nfs41_fh *fh)
Definition: nfs41_xdr.c:157
static EFI_HANDLE * handles
Definition: uefidisk.c:62
#define ZeroMemory
Definition: winbase.h:1712

Referenced by decode_file_layout().

◆ decode_fs_location4()

static bool_t decode_fs_location4 ( XDR xdr,
fs_location4 location 
)
static

Definition at line 377 of file nfs41_xdr.c.

380{
382 char *address;
384
385 /* decode the number of servers */
386 if (!xdr_u_int32_t(xdr, &count))
387 return FALSE;
388
389 /* allocate the fs_location_server array */
390 if (count == 0) {
391 free(location->servers);
392 arr = NULL;
393 } else if (count != location->server_count) {
394 arr = realloc(location->servers, count * sizeof(fs_location_server));
395 if (arr == NULL)
396 return FALSE;
397 ZeroMemory(arr, count * sizeof(fs_location_server));
398 } else {
399 arr = location->servers;
400 }
401
402 location->servers = arr;
403 location->server_count = count;
404
405 for (i = 0; i < count; i++) {
407 address = arr[i].address;
408 if (!xdr_bytes(xdr, &address, &len, NFS41_HOSTNAME_LEN)) {
409 free(arr);
410 return FALSE;
411 }
412 arr[i].address[len] = '\0';
413 }
414
415 return decode_pathname4(xdr, &location->path);
416}
GLuint address
Definition: glext.h:9393
#define NFS41_HOSTNAME_LEN
Definition: nfs41_const.h:48
static bool_t decode_pathname4(XDR *xdr, nfs41_abs_path *path)
Definition: nfs41_xdr.c:343
char address[NFS41_HOSTNAME_LEN+1]
Definition: nfs41_types.h:174

Referenced by decode_fs_locations4().

◆ decode_fs_locations4()

static bool_t decode_fs_locations4 ( XDR xdr,
fs_locations4 locations 
)
static

Definition at line 419 of file nfs41_xdr.c.

422{
424 fs_location4 *arr;
425
426 if (!decode_pathname4(xdr, &locations->path))
427 return FALSE;
428
429 if (!xdr_u_int32_t(xdr, &count))
430 return FALSE;
431
432 /* allocate the fs_location array */
433 if (count == 0) {
434 free(locations->locations);
435 arr = NULL;
436 } else if (count != locations->location_count) {
437 arr = realloc(locations->locations, count * sizeof(fs_location4));
438 if (arr == NULL)
439 return FALSE;
440 ZeroMemory(arr, count * sizeof(fs_location4));
441 } else {
442 arr = locations->locations;
443 }
444
445 locations->locations = arr;
446 locations->location_count = count;
447
448 for (i = 0; i < count; i++) {
449 if (!decode_fs_location4(xdr, &arr[i])) {
450 free(arr);
451 return FALSE;
452 }
453 }
454 return TRUE;
455}
GLsizei const GLint * locations
Definition: glext.h:10542
static bool_t decode_fs_location4(XDR *xdr, fs_location4 *location)
Definition: nfs41_xdr.c:377

Referenced by decode_file_attrs().

◆ decode_getdeviceinfo_ok()

static bool_t decode_getdeviceinfo_ok ( XDR xdr,
pnfs_getdeviceinfo_res_ok res_ok 
)
static

Definition at line 3130 of file nfs41_xdr.c.

3133{
3134 u_int32_t len_ignored;
3135
3136 if (!xdr_enum(xdr, (enum_t *)&res_ok->device->device.type))
3137 return FALSE;
3138
3139 if (res_ok->device->device.type != PNFS_LAYOUTTYPE_FILE)
3140 return FALSE;
3141
3142 if (!xdr_u_int32_t(xdr, &len_ignored))
3143 return FALSE;
3144
3145 if (!xdr_file_device(xdr, res_ok->device))
3146 return FALSE;
3147
3148 return xdr_bitmap4(xdr, &res_ok->notification);
3149}
bool_t xdr_enum(XDR *xdrs, enum_t *ep)
Definition: xdr.c:458
int32_t enum_t
Definition: types.h:102
static bool_t xdr_file_device(XDR *xdr, pnfs_file_device *device)
Definition: nfs41_xdr.c:3120
@ PNFS_LAYOUTTYPE_FILE
Definition: pnfs.h:75
enum pnfs_layout_type type
Definition: pnfs.h:117
pnfs_device device
Definition: pnfs.h:140
pnfs_file_device * device
Definition: nfs41_ops.h:983

Referenced by decode_op_getdeviceinfo().

◆ decode_layout()

static bool_t decode_layout ( XDR xdr,
struct list_entry list 
)
static

Definition at line 3366 of file nfs41_xdr.c.

3369{
3371
3372 if (!xdr_u_hyper(xdr, &layout.offset))
3373 return FALSE;
3374
3375 if (!xdr_u_hyper(xdr, &layout.length))
3376 return FALSE;
3377
3378 if (!xdr_enum(xdr, (enum_t *)&layout.iomode))
3379 return FALSE;
3380
3381 if (!xdr_enum(xdr, (enum_t *)&layout.type))
3382 return FALSE;
3383
3384 switch (layout.type) {
3386 return decode_file_layout(xdr, list, &layout);
3387
3388 default:
3389 eprintf("%s: received non-FILE layout type, %d\n",
3390 "decode_file_layout", layout.type);
3391 }
3392 return FALSE;
3393}
void eprintf(LPCSTR format,...)
Definition: daemon_debug.c:86
static bool_t decode_file_layout(XDR *xdr, struct list_entry *list, pnfs_layout *base)
Definition: nfs41_xdr.c:3322

Referenced by decode_layout_res_ok().

◆ decode_layout_res_ok()

static bool_t decode_layout_res_ok ( XDR xdr,
pnfs_layoutget_res_ok res 
)
static

Definition at line 3395 of file nfs41_xdr.c.

3398{
3399 uint32_t i;
3400
3401 if (!xdr_bool(xdr, &res->return_on_close))
3402 return FALSE;
3403
3404 if (!xdr_stateid4(xdr, &res->stateid))
3405 return FALSE;
3406
3407 if (!xdr_u_int32_t(xdr, &res->count))
3408 return FALSE;
3409
3410 for (i = 0; i < res->count; i++)
3411 if (!decode_layout(xdr, &res->layouts))
3412 return FALSE;
3413 return TRUE;
3414}
GLuint res
Definition: glext.h:9613
static bool_t decode_layout(XDR *xdr, struct list_entry *list)
Definition: nfs41_xdr.c:3366
static bool_t xdr_stateid4(XDR *xdr, stateid4 *si)
Definition: nfs41_xdr.c:133

Referenced by decode_op_layoutget().

◆ decode_lock_res_denied()

static bool_t decode_lock_res_denied ( XDR xdr,
lock_res_denied denied 
)
static

Definition at line 1501 of file nfs41_xdr.c.

1504{
1505 if (!xdr_u_hyper(xdr, &denied->offset))
1506 return FALSE;
1507
1508 if (!xdr_u_hyper(xdr, &denied->length))
1509 return FALSE;
1510
1511 if (!xdr_u_int32_t(xdr, &denied->locktype))
1512 return FALSE;
1513
1514 return xdr_state_owner4(xdr, &denied->owner);
1515}
static bool_t xdr_state_owner4(XDR *xdr, state_owner4 *so)
Definition: nfs41_xdr.c:200
uint32_t locktype
Definition: nfs41_ops.h:438
uint64_t offset
Definition: nfs41_ops.h:436
state_owner4 owner
Definition: nfs41_ops.h:439
uint64_t length
Definition: nfs41_ops.h:437

Referenced by decode_op_lock(), and decode_op_lockt().

◆ decode_modified_limit4()

static bool_t decode_modified_limit4 ( XDR xdr,
uint64_t filesize 
)
static

Definition at line 2053 of file nfs41_xdr.c.

2056{
2057 uint32_t blocks, bytes_per_block;
2058
2059 if (!xdr_u_int32_t(xdr, &blocks))
2060 return FALSE;
2061
2062 if (!xdr_u_int32_t(xdr, &bytes_per_block))
2063 return FALSE;
2064
2065 *filesize = blocks * bytes_per_block;
2066 return TRUE;
2067}
static int blocks
Definition: mkdosfs.c:527

Referenced by decode_space_limit4().

◆ decode_op_access()

static bool_t decode_op_access ( XDR xdr,
nfs_resop4 resop 
)
static

Definition at line 1207 of file nfs41_xdr.c.

1210{
1212
1213 if (unexpected_op(resop->op, OP_ACCESS))
1214 return FALSE;
1215
1216 if (!xdr_u_int32_t(xdr, &res->status))
1217 return FALSE;
1218
1219 if (res->status == NFS4_OK)
1220 {
1221 if (!xdr_u_int32_t(xdr, &res->supported))
1222 return FALSE;
1223
1224 return xdr_u_int32_t(xdr, &res->access);
1225 }
1226 return TRUE;
1227}
if(dx< 0)
Definition: linetemp.h:194
@ NFS4_OK
Definition: nfs41_const.h:87
@ OP_ACCESS
Definition: nfs41_ops.h:31
static __inline int unexpected_op(uint32_t op, uint32_t expected)
Definition: nfs41_xdr.c:36

◆ decode_op_bind_conn_to_session()

static bool_t decode_op_bind_conn_to_session ( XDR xdr,
nfs_resop4 resop 
)
static

Definition at line 897 of file nfs41_xdr.c.

900{
901 unsigned char sessionid_ignored[NFS4_SESSIONID_SIZE];
904 bool_t use_rdma_ignored;
905
907 return FALSE;
908
909 if (!xdr_enum(xdr, (enum_t *)&res->status))
910 return FALSE;
911
912 if (res->status == NFS4_OK) {
913 if (!xdr_opaque(xdr, (char *)&sessionid_ignored, NFS4_SESSIONID_SIZE))
914 return FALSE;
915
916 if (!xdr_enum(xdr, (enum_t *)&res->dir))
917 return FALSE;
918
919 return xdr_bool(xdr, &use_rdma_ignored);
920 }
921 return TRUE;
922}
#define NFS4_SESSIONID_SIZE
Definition: nfs41_const.h:32
@ OP_BIND_CONN_TO_SESSION
Definition: nfs41_ops.h:71

◆ decode_op_close()

static bool_t decode_op_close ( XDR xdr,
nfs_resop4 resop 
)
static

Definition at line 1249 of file nfs41_xdr.c.

1252{
1255
1256 if (unexpected_op(resop->op, OP_CLOSE))
1257 return FALSE;
1258
1259 if (!xdr_u_int32_t(xdr, &res->status))
1260 return FALSE;
1261
1262 if (res->status == NFS4_OK)
1263 return xdr_stateid4(xdr, &ignored);
1264
1265 return TRUE;
1266}
uint8_t ignored[3]
Definition: fsck.fat.h:0
@ OP_CLOSE
Definition: nfs41_ops.h:32

◆ decode_op_commit()

static bool_t decode_op_commit ( XDR xdr,
nfs_resop4 resop 
)
static

Definition at line 1287 of file nfs41_xdr.c.

1290{
1292
1293 if (unexpected_op(resop->op, OP_COMMIT))
1294 return FALSE;
1295
1296 if (!xdr_u_int32_t(xdr, &res->status))
1297 return FALSE;
1298
1299 if (res->status == NFS4_OK)
1300 return xdr_opaque(xdr, (char *)res->verf->verf, NFS4_VERIFIER_SIZE);
1301
1302 return TRUE;
1303}
#define NFS4_VERIFIER_SIZE
Definition: nfs41_const.h:30
@ OP_COMMIT
Definition: nfs41_ops.h:33

◆ decode_op_create()

static bool_t decode_op_create ( XDR xdr,
nfs_resop4 resop 
)
static

Definition at line 1384 of file nfs41_xdr.c.

1387{
1389
1390 if (unexpected_op(resop->op, OP_CREATE))
1391 return FALSE;
1392
1393 if (!xdr_u_int32_t(xdr, &res->status))
1394 return FALSE;
1395
1396 if (res->status == NFS4_OK)
1397 {
1398 if (!xdr_change_info4(xdr, &res->cinfo))
1399 return FALSE;
1400 return xdr_bitmap4(xdr, &res->attrset);
1401 }
1402 return TRUE;
1403}
@ OP_CREATE
Definition: nfs41_ops.h:34
static bool_t xdr_change_info4(XDR *xdr, change_info4 *cinfo)
Definition: nfs41_xdr.c:1371

◆ decode_op_create_session()

static bool_t decode_op_create_session ( XDR xdr,
nfs_resop4 resop 
)
static

Definition at line 837 of file nfs41_xdr.c.

840{
841 uint32_t opstatus;
843
845 return FALSE;
846
847 if (!xdr_u_int32_t(xdr, &opstatus))
848 return FALSE;
849
850 if (opstatus != NFS4_OK)
851 return TRUE;
852
853 if (!xdr_opaque(xdr, (char *)res->csr_sessionid, NFS4_SESSIONID_SIZE))
854 return FALSE;
855
856 /* sequenceid4 csr_sequence */
857 if (!xdr_u_int32_t(xdr, &res->csr_sequence))
858 return FALSE;
859
860 /* uint32_t csr_flags */
861 if (!xdr_u_int32_t(xdr, &res->csr_flags))
862 return FALSE;
863
864 /* channel_attrs4 csr_fore_chan_attrs */
865 if (!xdr_channel_attrs4(xdr, res->csr_fore_chan_attrs))
866 return FALSE;
867
868 /* channel_attrs4 csr_back_chan_attrs */
869 return xdr_channel_attrs4(xdr, res->csr_back_chan_attrs);
870}
@ OP_CREATE_SESSION
Definition: nfs41_ops.h:73
static bool_t xdr_channel_attrs4(XDR *xdr, nfs41_channel_attrs *attrs)
Definition: nfs41_xdr.c:710

◆ decode_op_delegpurge()

static bool_t decode_op_delegpurge ( XDR xdr,
nfs_resop4 resop 
)
static

Definition at line 1650 of file nfs41_xdr.c.

1653{
1655
1656 if (unexpected_op(resop->op, OP_DELEGPURGE))
1657 return FALSE;
1658
1659 return xdr_u_int32_t(xdr, &res->status);
1660}
@ OP_DELEGPURGE
Definition: nfs41_ops.h:35

◆ decode_op_delegreturn()

static bool_t decode_op_delegreturn ( XDR xdr,
nfs_resop4 resop 
)
static

Definition at line 1678 of file nfs41_xdr.c.

1681{
1683
1685 return FALSE;
1686
1687 return xdr_u_int32_t(xdr, &res->status);
1688}
@ OP_DELEGRETURN
Definition: nfs41_ops.h:36

◆ decode_op_destroy_clientid()

static bool_t decode_op_destroy_clientid ( XDR xdr,
nfs_resop4 resop 
)
static

Definition at line 967 of file nfs41_xdr.c.

970{
972
974 return FALSE;
975
976 return xdr_u_int32_t(xdr, &res->dcr_status);
977}
@ OP_DESTROY_CLIENTID
Definition: nfs41_ops.h:87

◆ decode_op_destroy_session()

static bool_t decode_op_destroy_session ( XDR xdr,
nfs_resop4 resop 
)
static

Definition at line 940 of file nfs41_xdr.c.

943{
945
947 return FALSE;
948
949 return xdr_u_int32_t(xdr, &res->dsr_status);
950}
@ OP_DESTROY_SESSION
Definition: nfs41_ops.h:74

◆ decode_op_exchange_id()

static bool_t decode_op_exchange_id ( XDR xdr,
nfs_resop4 resop 
)
static

Definition at line 672 of file nfs41_xdr.c.

675{
677 char *server_scope = (char *)res->server_scope;
678
679 if (unexpected_op(resop->op, OP_EXCHANGE_ID))
680 return FALSE;
681
682 if (!xdr_u_int32_t(xdr, &res->status))
683 return FALSE;
684
685 if (res->status != NFS4_OK)
686 return TRUE;
687
688 if (!xdr_u_hyper(xdr, &res->clientid))
689 return FALSE;
690
691 if (!xdr_u_int32_t(xdr, &res->sequenceid))
692 return FALSE;
693
694 if (!xdr_u_int32_t(xdr, &res->flags))
695 return FALSE;
696
697 if (!xdr_state_protect4_r(xdr, &res->state_protect))
698 return FALSE;
699
700 if (!xdr_server_owner4(xdr, &res->server_owner))
701 return FALSE;
702
703 return xdr_bytes(xdr, &server_scope,
704 &res->server_scope_len, NFS4_OPAQUE_LIMIT);
705}
@ OP_EXCHANGE_ID
Definition: nfs41_ops.h:72
static bool_t xdr_state_protect4_r(XDR *xdr, state_protect4_r *spr)
Definition: nfs41_xdr.c:629
static bool_t xdr_server_owner4(XDR *xdr, server_owner4 *so)
Definition: nfs41_xdr.c:659

◆ decode_op_free_stateid()

static bool_t decode_op_free_stateid ( XDR xdr,
nfs_resop4 resop 
)
static

Definition at line 2778 of file nfs41_xdr.c.

2781{
2783
2785 return FALSE;
2786
2787 return xdr_u_int32_t(xdr, &res->status);
2788}
@ OP_FREE_STATEID
Definition: nfs41_ops.h:75

◆ decode_op_getattr()

static bool_t decode_op_getattr ( XDR xdr,
nfs_resop4 resop 
)
static

Definition at line 1874 of file nfs41_xdr.c.

1877{
1879
1880 if (unexpected_op(resop->op, OP_GETATTR))
1881 return FALSE;
1882
1883 if (!xdr_u_int32_t(xdr, &res->status))
1884 return FALSE;
1885
1886 if (res->status == NFS4_OK)
1887 {
1888 XDR attr_xdr;
1889
1890 if (!xdr_fattr4(xdr, &res->obj_attributes))
1891 return FALSE;
1892 xdrmem_create(&attr_xdr, (char *)res->obj_attributes.attr_vals, res->obj_attributes.attr_vals_len, XDR_DECODE);
1893 return decode_file_attrs(&attr_xdr, &res->obj_attributes, res->info);
1894 }
1895 return TRUE;
1896}
@ OP_GETATTR
Definition: nfs41_ops.h:37
static bool_t decode_file_attrs(XDR *xdr, fattr4 *attrs, nfs41_file_info *info)
Definition: nfs41_xdr.c:1706
bool_t xdr_fattr4(XDR *xdr, fattr4 *fattr)
Definition: nfs41_xdr.c:144
Definition: xdr.h:103
@ XDR_DECODE
Definition: xdr.h:86
void xdrmem_create(XDR *xdrs, char *addr, u_int size, enum xdr_op op)
Definition: xdr_mem.c:94

◆ decode_op_getdeviceinfo()

static bool_t decode_op_getdeviceinfo ( XDR xdr,
nfs_resop4 resop 
)
static

Definition at line 3151 of file nfs41_xdr.c.

3154{
3156
3158 return FALSE;
3159
3160 if (!xdr_u_int32_t(xdr, (uint32_t *)&res->status))
3161 return FALSE;
3162
3163 switch (res->status) {
3164 case NFS4_OK:
3165 return decode_getdeviceinfo_ok(xdr, &res->u.res_ok);
3166 break;
3167 case NFS4ERR_TOOSMALL:
3168 {
3170 return xdr_u_int32_t(xdr, &ignored);
3171 }
3172 break;
3173 }
3174 return TRUE;
3175}
@ NFS4ERR_TOOSMALL
Definition: nfs41_const.h:110
@ OP_GETDEVICEINFO
Definition: nfs41_ops.h:77
static bool_t decode_getdeviceinfo_ok(XDR *xdr, pnfs_getdeviceinfo_res_ok *res_ok)
Definition: nfs41_xdr.c:3130

◆ decode_op_getfh()

static bool_t decode_op_getfh ( XDR xdr,
nfs_resop4 resop 
)
static

Definition at line 1145 of file nfs41_xdr.c.

1148{
1150
1151 if (unexpected_op(resop->op, OP_GETFH))
1152 return FALSE;
1153
1154 if (!xdr_u_int32_t(xdr, &res->status))
1155 return FALSE;
1156
1157 if (res->status == NFS4_OK)
1158 return xdr_fh(xdr, res->fh);
1159
1160 return TRUE;
1161}
@ OP_GETFH
Definition: nfs41_ops.h:38

◆ decode_op_layoutcommit()

static bool_t decode_op_layoutcommit ( XDR xdr,
nfs_resop4 resop 
)
static

Definition at line 3237 of file nfs41_xdr.c.

3240{
3242
3244 return FALSE;
3245
3246 if (!xdr_u_int32_t(xdr, &res->status))
3247 return FALSE;
3248
3249 if (res->status == NFS4_OK) {
3250 if (!xdr_bool(xdr, &res->has_new_size))
3251 return FALSE;
3252
3253 if (res->has_new_size)
3254 if (!xdr_u_hyper(xdr, &res->new_size))
3255 return FALSE;
3256 }
3257 return TRUE;
3258}
@ OP_LAYOUTCOMMIT
Definition: nfs41_ops.h:79

◆ decode_op_layoutget()

static bool_t decode_op_layoutget ( XDR xdr,
nfs_resop4 resop 
)
static

Definition at line 3416 of file nfs41_xdr.c.

3419{
3421
3422 if (unexpected_op(resop->op, OP_LAYOUTGET))
3423 return FALSE;
3424
3425 if (!xdr_u_int32_t(xdr, (uint32_t *)&res->status))
3426 return FALSE;
3427
3428 switch (res->status) {
3429 case NFS4_OK:
3430 return decode_layout_res_ok(xdr, res->u.res_ok);
3432 return xdr_bool(xdr, &res->u.will_signal_layout_avail);
3433 }
3434 return TRUE;
3435}
@ NFS4ERR_LAYOUTTRYLATER
Definition: nfs41_const.h:167
@ OP_LAYOUTGET
Definition: nfs41_ops.h:80
static bool_t decode_layout_res_ok(XDR *xdr, pnfs_layoutget_res_ok *res)
Definition: nfs41_xdr.c:3395

◆ decode_op_layoutreturn()

static bool_t decode_op_layoutreturn ( XDR xdr,
nfs_resop4 resop 
)
static

Definition at line 3482 of file nfs41_xdr.c.

3485{
3487
3489 return FALSE;
3490
3491 if (!xdr_u_int32_t(xdr, (uint32_t *)&res->status))
3492 return FALSE;
3493
3494 if (res->status == NFS4_OK) {
3495 if (!xdr_bool(xdr, &res->stateid_present))
3496 return FALSE;
3497
3498 if (res->stateid_present)
3499 return xdr_stateid4(xdr, &res->stateid);
3500 }
3501 return TRUE;
3502}
@ OP_LAYOUTRETURN
Definition: nfs41_ops.h:81

◆ decode_op_link()

static bool_t decode_op_link ( XDR xdr,
nfs_resop4 resop 
)
static

Definition at line 1421 of file nfs41_xdr.c.

1424{
1426
1427 if (unexpected_op(resop->op, OP_LINK))
1428 return FALSE;
1429
1430 if (!xdr_u_int32_t(xdr, &res->status))
1431 return FALSE;
1432
1433 if (res->status == NFS4_OK)
1434 return xdr_change_info4(xdr, &res->cinfo);
1435
1436 return TRUE;
1437}
@ OP_LINK
Definition: nfs41_ops.h:39

◆ decode_op_lock()

static bool_t decode_op_lock ( XDR xdr,
nfs_resop4 resop 
)
static

Definition at line 1517 of file nfs41_xdr.c.

1520{
1522
1523 if (unexpected_op(resop->op, OP_LOCK))
1524 return FALSE;
1525
1526 if (!xdr_u_int32_t(xdr, &res->status))
1527 return FALSE;
1528
1529 switch (res->status) {
1530 case NFS4_OK:
1531 return xdr_stateid4(xdr, res->u.resok4.lock_stateid);
1532 break;
1533 case NFS4ERR_DENIED:
1534 return decode_lock_res_denied(xdr, &res->u.denied);
1535 break;
1536 default:
1537 break;
1538 }
1539
1540 return TRUE;
1541}
@ NFS4ERR_DENIED
Definition: nfs41_const.h:115
@ OP_LOCK
Definition: nfs41_ops.h:40
static bool_t decode_lock_res_denied(XDR *xdr, lock_res_denied *denied)
Definition: nfs41_xdr.c:1501

◆ decode_op_lockt()

static bool_t decode_op_lockt ( XDR xdr,
nfs_resop4 resop 
)
static

Definition at line 1568 of file nfs41_xdr.c.

1571{
1573
1574 if (unexpected_op(resop->op, OP_LOCKT))
1575 return FALSE;
1576
1577 if (!xdr_u_int32_t(xdr, &res->status))
1578 return FALSE;
1579
1580 if (res->status == NFS4ERR_DENIED)
1581 return decode_lock_res_denied(xdr, &res->denied);
1582
1583 return TRUE;
1584}
@ OP_LOCKT
Definition: nfs41_ops.h:41

◆ decode_op_locku()

static bool_t decode_op_locku ( XDR xdr,
nfs_resop4 resop 
)
static

Definition at line 1614 of file nfs41_xdr.c.

1617{
1619
1620 if (unexpected_op(resop->op, OP_LOCKU))
1621 return FALSE;
1622
1623 if (!xdr_u_int32_t(xdr, &res->status))
1624 return FALSE;
1625
1626 if (res->status == NFS4_OK)
1627 return xdr_stateid4(xdr, res->lock_stateid);
1628
1629 return TRUE;
1630}
@ OP_LOCKU
Definition: nfs41_ops.h:42

◆ decode_op_lookup()

static bool_t decode_op_lookup ( XDR xdr,
nfs_resop4 resop 
)
static

Definition at line 1179 of file nfs41_xdr.c.

1182{
1184
1185 if (unexpected_op(resop->op, OP_LOOKUP))
1186 return FALSE;
1187
1188 return xdr_u_int32_t(xdr, &res->status);
1189}
@ OP_LOOKUP
Definition: nfs41_ops.h:43

◆ decode_op_open()

static bool_t decode_op_open ( XDR xdr,
nfs_resop4 resop 
)
static

Definition at line 2149 of file nfs41_xdr.c.

2152{
2154
2155 if (unexpected_op(resop->op, OP_OPEN))
2156 return FALSE;
2157
2158 if (!xdr_u_int32_t(xdr, &res->status))
2159 return FALSE;
2160
2161 if (res->status == NFS4_OK)
2162 return decode_open_res_ok(xdr, &res->resok4);
2163
2164 return TRUE;
2165}
@ OP_OPEN
Definition: nfs41_ops.h:46
static bool_t decode_open_res_ok(XDR *xdr, nfs41_op_open_res_ok *res)
Definition: nfs41_xdr.c:2113

◆ decode_op_openattr()

static bool_t decode_op_openattr ( XDR xdr,
nfs_resop4 resop 
)
static

Definition at line 2183 of file nfs41_xdr.c.

2186{
2188
2189 if (unexpected_op(resop->op, OP_OPENATTR))
2190 return FALSE;
2191
2192 return xdr_u_int32_t(xdr, &res->status);
2193}
@ OP_OPENATTR
Definition: nfs41_ops.h:47

◆ decode_op_putfh()

static bool_t decode_op_putfh ( XDR xdr,
nfs_resop4 resop 
)
static

Definition at line 1092 of file nfs41_xdr.c.

1095{
1097
1098 if (unexpected_op(resop->op, OP_PUTFH))
1099 return FALSE;
1100
1101 return xdr_u_int32_t(xdr, &res->status);
1102}
@ OP_PUTFH
Definition: nfs41_ops.h:50

◆ decode_op_putrootfh()

static bool_t decode_op_putrootfh ( XDR xdr,
nfs_resop4 resop 
)
static

Definition at line 1118 of file nfs41_xdr.c.

1121{
1123
1124 if (unexpected_op(resop->op, OP_PUTROOTFH))
1125 return FALSE;
1126
1127 return xdr_u_int32_t(xdr, &res->status);
1128}
@ OP_PUTROOTFH
Definition: nfs41_ops.h:52

◆ decode_op_read()

static bool_t decode_op_read ( XDR xdr,
nfs_resop4 resop 
)
static

Definition at line 2229 of file nfs41_xdr.c.

2232{
2234
2235 if (unexpected_op(resop->op, OP_READ))
2236 return FALSE;
2237
2238 if (!xdr_u_int32_t(xdr, &res->status))
2239 return FALSE;
2240
2241 if (res->status == NFS4_OK)
2242 return decode_read_res_ok(xdr, &res->resok4);
2243
2244 return TRUE;
2245}
@ OP_READ
Definition: nfs41_ops.h:53
static bool_t decode_read_res_ok(XDR *xdr, nfs41_read_res_ok *res)
Definition: nfs41_xdr.c:2217

◆ decode_op_readdir()

static bool_t decode_op_readdir ( XDR xdr,
nfs_resop4 resop 
)
static

Definition at line 2379 of file nfs41_xdr.c.

2382{
2384
2385 if (unexpected_op(resop->op, OP_READDIR))
2386 return FALSE;
2387
2388 if (!xdr_u_int32_t(xdr, &res->status))
2389 return FALSE;
2390
2391 if (res->status == NFS4_OK) {
2392 if (!xdr_opaque(xdr, (char *)res->cookieverf, NFS4_VERIFIER_SIZE))
2393 return FALSE;
2394 return decode_readdir_list(xdr, &res->reply);
2395 }
2396 return TRUE;
2397}
@ OP_READDIR
Definition: nfs41_ops.h:54
static bool_t decode_readdir_list(XDR *xdr, nfs41_readdir_list *dirs)
Definition: nfs41_xdr.c:2346

◆ decode_op_readlink()

static bool_t decode_op_readlink ( XDR xdr,
nfs_resop4 resop 
)
static

Definition at line 2414 of file nfs41_xdr.c.

2417{
2419
2420 if (unexpected_op(resop->op, OP_READLINK))
2421 return FALSE;
2422
2423 if (!xdr_u_int32_t(xdr, &res->status))
2424 return FALSE;
2425
2426 if (res->status == NFS4_OK) {
2427 char *link = res->link;
2428 return xdr_bytes(xdr, &link, &res->link_len, res->link_len);
2429 }
2430
2431 return TRUE;
2432}
const WCHAR * link
Definition: db.cpp:997
@ OP_READLINK
Definition: nfs41_ops.h:55

◆ decode_op_reclaim_complete()

static bool_t decode_op_reclaim_complete ( XDR xdr,
nfs_resop4 resop 
)
static

Definition at line 1064 of file nfs41_xdr.c.

1067{
1069
1071 return FALSE;
1072
1073 return xdr_enum(xdr, (enum_t *)&res->status);
1074}
@ OP_RECLAIM_COMPLETE
Definition: nfs41_ops.h:88

◆ decode_op_remove()

static bool_t decode_op_remove ( XDR xdr,
nfs_resop4 resop 
)
static

Definition at line 2450 of file nfs41_xdr.c.

2453{
2455
2456 if (unexpected_op(resop->op, OP_REMOVE))
2457 return FALSE;
2458
2459 if (!xdr_u_int32_t(xdr, &res->status))
2460 return FALSE;
2461
2462 if (res->status == NFS4_OK)
2463 return xdr_change_info4(xdr, &res->cinfo);
2464
2465 return TRUE;
2466}
@ OP_REMOVE
Definition: nfs41_ops.h:56

◆ decode_op_rename()

static bool_t decode_op_rename ( XDR xdr,
nfs_resop4 resop 
)
static

Definition at line 2487 of file nfs41_xdr.c.

2490{
2492
2493 if (unexpected_op(resop->op, OP_RENAME))
2494 return FALSE;
2495
2496 if (!xdr_u_int32_t(xdr, &res->status))
2497 return FALSE;
2498
2499 if (res->status == NFS4_OK)
2500 {
2501 if (!xdr_change_info4(xdr, &res->source_cinfo))
2502 return FALSE;
2503 return xdr_change_info4(xdr, &res->target_cinfo);
2504 }
2505 return TRUE;
2506}
@ OP_RENAME
Definition: nfs41_ops.h:57

◆ decode_op_restorefh()

static bool_t decode_op_restorefh ( XDR xdr,
nfs_resop4 resop 
)
static

Definition at line 2523 of file nfs41_xdr.c.

2526{
2528
2529 if (unexpected_op(resop->op, OP_RESTOREFH))
2530 return FALSE;
2531
2532 return xdr_u_int32_t(xdr, &res->status);
2533}
@ OP_RESTOREFH
Definition: nfs41_ops.h:59

◆ decode_op_savefh()

static bool_t decode_op_savefh ( XDR xdr,
nfs_resop4 resop 
)
static

Definition at line 2550 of file nfs41_xdr.c.

2553{
2555
2556 if (unexpected_op(resop->op, OP_SAVEFH))
2557 return FALSE;
2558
2559 return xdr_u_int32_t(xdr, &res->status);
2560}
@ OP_SAVEFH
Definition: nfs41_ops.h:60

◆ decode_op_secinfo()

static bool_t decode_op_secinfo ( XDR xdr,
nfs_resop4 resop 
)
static

Definition at line 2963 of file nfs41_xdr.c.

2966{
2968 nfs41_secinfo_info *secinfo = res->secinfo;
2969
2970 if (unexpected_op(resop->op, OP_SECINFO))
2971 return FALSE;
2972
2973 if (!xdr_u_int32_t(xdr, &res->status))
2974 return FALSE;
2975
2976 if (res->status == NFS4_OK)
2977 return xdr_array(xdr, (char**)&secinfo, &res->count,
2979
2980 return TRUE;
2981}
#define MAX_SECINFOS
Definition: nfs41_ops.h:881
@ OP_SECINFO
Definition: nfs41_ops.h:61
static bool_t xdr_secinfo(XDR *xdr, nfs41_secinfo_info *secinfo)
Definition: nfs41_xdr.c:2893

◆ decode_op_secinfo_noname()

static bool_t decode_op_secinfo_noname ( XDR xdr,
nfs_resop4 resop 
)
static

Definition at line 2926 of file nfs41_xdr.c.

2929{
2931 nfs41_secinfo_info *secinfo = res->secinfo;
2933 return FALSE;
2934
2935 if (!xdr_u_int32_t(xdr, &res->status))
2936 return FALSE;
2937
2938 if (res->status == NFS4_OK)
2939 return xdr_array(xdr, (char**)&secinfo, &res->count,
2941
2942 return TRUE;
2943}
@ OP_SECINFO_NO_NAME
Definition: nfs41_ops.h:82

◆ decode_op_sequence()

static bool_t decode_op_sequence ( XDR xdr,
nfs_resop4 resop 
)
static

Definition at line 1029 of file nfs41_xdr.c.

1032{
1034
1035 if (unexpected_op(resop->op, OP_SEQUENCE))
1036 return FALSE;
1037
1038 if (!xdr_u_int32_t(xdr, &res->sr_status))
1039 return FALSE;
1040
1041 if (res->sr_status == NFS4_OK)
1042 return xdr_sequence_res_ok(xdr, &res->sr_resok4);
1043
1044 return TRUE;
1045}
@ OP_SEQUENCE
Definition: nfs41_ops.h:83
static bool_t xdr_sequence_res_ok(XDR *xdr, nfs41_sequence_res_ok *res)
Definition: nfs41_xdr.c:1007

◆ decode_op_setattr()

static bool_t decode_op_setattr ( XDR xdr,
nfs_resop4 resop 
)
static

Definition at line 2686 of file nfs41_xdr.c.

2689{
2691
2692 if (unexpected_op(resop->op, OP_SETATTR))
2693 return FALSE;
2694
2695 if (!xdr_u_int32_t(xdr, &res->status))
2696 return FALSE;
2697
2698 if (res->status == NFS4_OK)
2699 return xdr_bitmap4(xdr, &res->attrsset);
2700
2701 return TRUE;
2702}
@ OP_SETATTR
Definition: nfs41_ops.h:62

◆ decode_op_test_stateid()

static bool_t decode_op_test_stateid ( XDR xdr,
nfs_resop4 resop 
)
static

Definition at line 2807 of file nfs41_xdr.c.

2810{
2812
2814 return FALSE;
2815
2816 if (!xdr_u_int32_t(xdr, &res->status))
2817 return FALSE;
2818
2819 if (res->status == NFS4_OK) {
2820 return xdr_array(xdr, (char**)&res->resok.status, &res->resok.count,
2821 res->resok.count, sizeof(uint32_t), (xdrproc_t)xdr_u_int32_t);
2822 }
2823 return TRUE;
2824}
@ OP_TEST_STATEID
Definition: nfs41_ops.h:85

◆ decode_op_want_delegation()

static bool_t decode_op_want_delegation ( XDR xdr,
nfs_resop4 resop 
)
static

Definition at line 2727 of file nfs41_xdr.c.

2730{
2732
2734 return FALSE;
2735
2736 if (!xdr_u_int32_t(xdr, &res->status))
2737 return FALSE;
2738
2739 if (res->status)
2740 return TRUE;
2741
2742 if (!xdr_enum(xdr, (enum_t*)&res->delegation->type))
2743 return FALSE;
2744
2745 switch (res->delegation->type)
2746 {
2747 case OPEN_DELEGATE_NONE:
2748 return TRUE;
2750 return decode_open_none_delegation4(xdr, res->delegation);
2751 case OPEN_DELEGATE_READ:
2752 return decode_open_read_delegation4(xdr, res->delegation);
2754 return decode_open_write_delegation4(xdr, res->delegation);
2755 default:
2756 eprintf("decode_open_res_ok: delegation type %d not "
2757 "supported.\n", res->delegation->type);
2758 return FALSE;
2759 }
2760}
@ OPEN_DELEGATE_NONE_EXT
Definition: nfs41_ops.h:589
@ OPEN_DELEGATE_NONE
Definition: nfs41_ops.h:586
@ OPEN_DELEGATE_READ
Definition: nfs41_ops.h:587
@ OPEN_DELEGATE_WRITE
Definition: nfs41_ops.h:588
@ OP_WANT_DELEGATION
Definition: nfs41_ops.h:86
static bool_t decode_open_write_delegation4(XDR *xdr, open_delegation4 *delegation)
Definition: nfs41_xdr.c:2095
static bool_t decode_open_read_delegation4(XDR *xdr, open_delegation4 *delegation)
Definition: nfs41_xdr.c:2040
static bool_t decode_open_none_delegation4(XDR *xdr, open_delegation4 *delegation)
Definition: nfs41_xdr.c:2020

◆ decode_op_write()

static bool_t decode_op_write ( XDR xdr,
nfs_resop4 resop 
)
static

Definition at line 2872 of file nfs41_xdr.c.

2875{
2877
2878 if (unexpected_op(resop->op, OP_WRITE))
2879 return FALSE;
2880
2881 if (!xdr_u_int32_t(xdr, &res->status))
2882 return FALSE;
2883
2884 if (res->status == NFS4_OK)
2885 return xdr_write_res_ok(xdr, &res->resok4);
2886
2887 return TRUE;
2888}
@ OP_WRITE
Definition: nfs41_ops.h:66
static bool_t xdr_write_res_ok(XDR *xdr, nfs41_write_res_ok *res)
Definition: nfs41_xdr.c:2862

◆ decode_open_none_delegation4()

static bool_t decode_open_none_delegation4 ( XDR xdr,
open_delegation4 delegation 
)
static

Definition at line 2020 of file nfs41_xdr.c.

2023{
2024 enum_t why_no_deleg;
2025 bool_t will_signal;
2026
2027 if (!xdr_enum(xdr, (enum_t*)&why_no_deleg))
2028 return FALSE;
2029
2030 switch (why_no_deleg)
2031 {
2032 case WND4_CONTENTION:
2033 case WND4_RESOURCE:
2034 return xdr_bool(xdr, &will_signal);
2035 default:
2036 return TRUE;
2037 }
2038}
@ WND4_RESOURCE
Definition: nfs41_ops.h:605
@ WND4_CONTENTION
Definition: nfs41_ops.h:604

Referenced by decode_op_want_delegation(), and decode_open_res_ok().

◆ decode_open_read_delegation4()

static bool_t decode_open_read_delegation4 ( XDR xdr,
open_delegation4 delegation 
)
static

Definition at line 2040 of file nfs41_xdr.c.

2043{
2044 if (!xdr_stateid4(xdr, &delegation->stateid))
2045 return FALSE;
2046
2047 if (!xdr_bool(xdr, &delegation->recalled))
2048 return FALSE;
2049
2050 return xdr_nfsace4(xdr, &delegation->permissions);
2051}

Referenced by decode_op_want_delegation(), and decode_open_res_ok().

◆ decode_open_res_ok()

static bool_t decode_open_res_ok ( XDR xdr,
nfs41_op_open_res_ok res 
)
static

Definition at line 2113 of file nfs41_xdr.c.

2116{
2117 if (!xdr_stateid4(xdr, res->stateid))
2118 return FALSE;
2119
2120 if (!xdr_change_info4(xdr, &res->cinfo))
2121 return FALSE;
2122
2123 if (!xdr_u_int32_t(xdr, &res->rflags))
2124 return FALSE;
2125
2126 if (!xdr_bitmap4(xdr, &res->attrset))
2127 return FALSE;
2128
2129 if (!xdr_enum(xdr, (enum_t*)&res->delegation->type))
2130 return FALSE;
2131
2132 switch (res->delegation->type)
2133 {
2134 case OPEN_DELEGATE_NONE:
2135 return TRUE;
2137 return decode_open_none_delegation4(xdr, res->delegation);
2138 case OPEN_DELEGATE_READ:
2139 return decode_open_read_delegation4(xdr, res->delegation);
2141 return decode_open_write_delegation4(xdr, res->delegation);
2142 default:
2143 eprintf("decode_open_res_ok: delegation type %d not "
2144 "supported.\n", res->delegation->type);
2145 return FALSE;
2146 }
2147}

Referenced by decode_op_open().

◆ decode_open_write_delegation4()

static bool_t decode_open_write_delegation4 ( XDR xdr,
open_delegation4 delegation 
)
static

Definition at line 2095 of file nfs41_xdr.c.

2098{
2099 uint64_t size_limit;
2100
2101 if (!xdr_stateid4(xdr, &delegation->stateid))
2102 return FALSE;
2103
2104 if (!xdr_bool(xdr, &delegation->recalled))
2105 return FALSE;
2106
2107 if (!decode_space_limit4(xdr, &size_limit))
2108 return FALSE;
2109
2110 return xdr_nfsace4(xdr, &delegation->permissions);
2111}
UINT64 uint64_t
Definition: types.h:77
static bool_t decode_space_limit4(XDR *xdr, uint64_t *filesize)
Definition: nfs41_xdr.c:2074

Referenced by decode_op_want_delegation(), and decode_open_res_ok().

◆ decode_pathname4()

static bool_t decode_pathname4 ( XDR xdr,
nfs41_abs_path path 
)
static

Definition at line 343 of file nfs41_xdr.c.

346{
347 char *pos;
348 u_int32_t i, count, len, remaining;
349
350 /* decode the number of components */
351 if (!xdr_u_int32_t(xdr, &count))
352 return FALSE;
353
354 pos = (char *)path->path;
355 remaining = NFS41_MAX_PATH_LEN;
356
357 /* decode each component */
358 for (i = 0; i < count; i++) {
359 len = remaining;
360 if (!xdr_bytes(xdr, (char **)&pos, &len, NFS41_MAX_PATH_LEN))
361 return FALSE;
362 remaining -= len;
363 pos += len;
364
365 if (i < count-1) { /* add a \ between components */
366 if (remaining < 1)
367 return FALSE;
368 *pos++ = '\\';
369 remaining--;
370 }
371 }
372 path->len = (unsigned short)(NFS41_MAX_PATH_LEN - remaining);
373 return TRUE;
374}
unsigned short(__cdecl typeof(TIFFCurrentDirectory))(struct tiff *)
Definition: typeof.h:94
#define for
Definition: utility.h:88
#define NFS41_MAX_PATH_LEN
Definition: nfs41_const.h:46

Referenced by decode_fs_location4(), and decode_fs_locations4().

◆ decode_read_res_ok()

static bool_t decode_read_res_ok ( XDR xdr,
nfs41_read_res_ok res 
)
static

Definition at line 2217 of file nfs41_xdr.c.

2220{
2221 unsigned char *data = res->data;
2222
2223 if (!xdr_bool(xdr, &res->eof))
2224 return FALSE;
2225
2226 return xdr_bytes(xdr, (char **)&data, &res->data_len, NFS41_MAX_FILEIO_SIZE);
2227}
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
#define NFS41_MAX_FILEIO_SIZE
Definition: nfs41_const.h:38

Referenced by decode_op_read().

◆ decode_readdir_entry()

static bool_t decode_readdir_entry ( XDR xdr,
readdir_entry_iterator it 
)
static

Definition at line 2283 of file nfs41_xdr.c.

2286{
2288 unsigned char name[NFS4_OPAQUE_LIMIT];
2289 unsigned char *nameptr = &name[0];
2290 uint32_t name_len, entry_len;
2291 fattr4 attrs;
2292
2293 /* decode into temporaries so we can determine if there's enough
2294 * room in the buffer for this entry */
2296 name_len = NFS4_OPAQUE_LIMIT;
2299
2300 if (!xdr_u_hyper(xdr, &cookie))
2301 return FALSE;
2302
2303 if (!xdr_bytes(xdr, (char **)&nameptr, &name_len, NFS4_OPAQUE_LIMIT))
2304 return FALSE;
2305
2306 if (!xdr_fattr4(xdr, &attrs))
2307 return FALSE;
2308
2309 if (!xdr_bool(xdr, &it->has_next_entry))
2310 return FALSE;
2311
2312 if (it->ignore_the_rest)
2313 return TRUE;
2314
2315 name_len += 1; /* account for null terminator */
2316 if (entry_len + name_len <= it->remaining_len)
2317 {
2318 XDR fattr_xdr;
2320 entry->cookie = cookie;
2321 entry->name_len = name_len;
2322
2323 if (it->has_next_entry)
2324 entry->next_entry_offset = entry_len + name_len;
2325 else
2326 entry->next_entry_offset = 0;
2327
2328 xdrmem_create(&fattr_xdr, (char *)attrs.attr_vals, attrs.attr_vals_len, XDR_DECODE);
2329 if (!(decode_file_attrs(&fattr_xdr, &attrs, &entry->attr_info)))
2330 entry->attr_info.rdattr_error = NFS4ERR_BADXDR;
2331 StringCchCopyA(entry->name, name_len, (STRSAFE_LPCSTR)name);
2332
2333 it->buf_pos += entry_len + name_len;
2334 it->remaining_len -= entry_len + name_len;
2335 it->last_entry_offset = &entry->next_entry_offset;
2336 }
2337 else if (it->last_entry_offset)
2338 {
2339 *(it->last_entry_offset) = 0;
2340 it->ignore_the_rest = 1;
2341 }
2342
2343 return TRUE;
2344}
uint32_t entry
Definition: isohybrid.c:63
@ NFS4ERR_BADXDR
Definition: nfs41_const.h:143
#define uint32_t
Definition: nsiface.idl:61
const char * STRSAFE_LPCSTR
Definition: ntstrsafe.h:52
STRSAFEAPI StringCchCopyA(STRSAFE_LPSTR pszDest, size_t cchDest, STRSAFE_LPCSTR pszSrc)
Definition: strsafe.h:145
uint32_t attr_vals_len
Definition: nfs41_types.h:161
unsigned char attr_vals[NFS4_OPAQUE_LIMIT]
Definition: nfs41_types.h:162
Definition: nfs41_ops.h:710
bool_t ignore_the_rest
Definition: nfs41_xdr.c:2279
uint32_t remaining_len
Definition: nfs41_xdr.c:2277
uint32_t * last_entry_offset
Definition: nfs41_xdr.c:2278
bool_t has_next_entry
Definition: nfs41_xdr.c:2280
unsigned char * buf_pos
Definition: nfs41_xdr.c:2276
Definition: cookie.c:34
Definition: name.c:39
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:255

Referenced by decode_readdir_list().

◆ decode_readdir_list()

static bool_t decode_readdir_list ( XDR xdr,
nfs41_readdir_list dirs 
)
static

Definition at line 2346 of file nfs41_xdr.c.

2349{
2351 iter.buf_pos = dirs->entries;
2352 iter.remaining_len = dirs->entries_len;
2353 iter.last_entry_offset = NULL;
2354 iter.ignore_the_rest = 0;
2355 iter.has_next_entry = 0;
2356
2357 if (!xdr_bool(xdr, &dirs->has_entries))
2358 return FALSE;
2359
2360 if (dirs->has_entries)
2361 {
2362 do {
2363 if (!decode_readdir_entry(xdr, &iter))
2364 return FALSE;
2365
2366 } while (iter.has_next_entry);
2367 }
2368 dirs->entries_len -= iter.remaining_len;
2369
2370 if (!xdr_bool(xdr, &dirs->eof))
2371 return FALSE;
2372
2373 /* reset eof if we couldn't fit everything in the buffer */
2374 if (iter.ignore_the_rest)
2375 dirs->eof = 0;
2376 return TRUE;
2377}
static bool_t decode_readdir_entry(XDR *xdr, readdir_entry_iterator *it)
Definition: nfs41_xdr.c:2283
uint32_t entries_len
Definition: nfs41_ops.h:720
unsigned char * entries
Definition: nfs41_ops.h:721
Definition: nfs41_xdr.c:2275

Referenced by decode_op_readdir().

◆ decode_space_limit4()

static bool_t decode_space_limit4 ( XDR xdr,
uint64_t filesize 
)
static

Definition at line 2074 of file nfs41_xdr.c.

2077{
2078 uint32_t limitby;
2079
2080 if (!xdr_u_int32_t(xdr, &limitby))
2081 return FALSE;
2082
2083 switch (limitby)
2084 {
2085 case NFS_LIMIT_SIZE:
2086 return xdr_u_hyper(xdr, filesize);
2087 case NFS_LIMIT_BLOCKS:
2088 return decode_modified_limit4(xdr, filesize);
2089 default:
2090 eprintf("decode_space_limit4: limitby %d invalid\n", limitby);
2091 return FALSE;
2092 }
2093}
static bool_t decode_modified_limit4(XDR *xdr, uint64_t *filesize)
Definition: nfs41_xdr.c:2053

Referenced by decode_open_write_delegation4().

◆ encode_backchannel_sec_parms()

static bool_t encode_backchannel_sec_parms ( XDR xdr,
nfs41_callback_secparms args 
)
static

Definition at line 774 of file nfs41_xdr.c.

777{
778 uint32_t zero = 0;
779
780 if (!xdr_u_int32_t(xdr, &args->type))
781 return FALSE;
782
783 switch (args->type) {
784 case AUTH_NONE: return TRUE;
785 case AUTH_SYS:
786 if (!xdr_u_int32_t(xdr, &args->u.auth_sys.stamp))
787 return FALSE;
788 if (!xdr_string(xdr, &args->u.auth_sys.machinename, NI_MAXHOST))
789 return FALSE;
790 return xdr_u_int32_t(xdr, &zero) && xdr_u_int32_t(xdr, &zero) &&
791 xdr_u_int32_t(xdr, &zero);
792 case RPCSEC_GSS:
793 default:
794 return FALSE;
795 }
796}
bool_t xdr_string(XDR *xdrs, char **cpp, u_int maxsize)
Definition: xdr.c:678
#define AUTH_SYS
Definition: auth.h:403
#define AUTH_NONE
Definition: auth.h:401
#define RPCSEC_GSS
Definition: nfs41_ops.h:867
int zero
Definition: sehframes.cpp:29
Definition: match.c:390
#define NI_MAXHOST
Definition: ws2def.h:359

Referenced by encode_op_create_session().

◆ encode_claim_deleg_cur()

static bool_t encode_claim_deleg_cur ( XDR xdr,
stateid4 stateid,
nfs41_component name 
)
static

Definition at line 1950 of file nfs41_xdr.c.

1954{
1955 if (!xdr_stateid4(xdr, stateid))
1956 return FALSE;
1957 return encode_component(xdr, name);
1958}
static bool_t encode_component(XDR *xdr, const nfs41_component *component)
Definition: nfs41_xdr.c:178

Referenced by encode_open_claim4().

◆ encode_component()

static bool_t encode_component ( XDR xdr,
const nfs41_component component 
)
static

Definition at line 178 of file nfs41_xdr.c.

181{
182 uint32_t len = component->len;
183 return xdr_bytes(xdr, (char **)&component->name, &len, NFS4_OPAQUE_LIMIT);
184}

Referenced by encode_claim_deleg_cur(), encode_op_create(), encode_op_link(), encode_op_lookup(), encode_op_remove(), encode_op_rename(), encode_op_secinfo(), and encode_open_claim4().

◆ encode_createattrs4()

static bool_t encode_createattrs4 ( XDR xdr,
nfs41_file_info createattrs 
)
static

Definition at line 1339 of file nfs41_xdr.c.

1342{
1343 fattr4 attrs;
1344
1345 /* encode attribute values from createattrs->info into attrs.attr_vals */
1347 if (!encode_file_attrs(&attrs, createattrs))
1348 return FALSE;
1349
1350 return xdr_fattr4(xdr, &attrs);
1351}
static bool_t encode_file_attrs(fattr4 *attrs, nfs41_file_info *info)
Definition: nfs41_xdr.c:2566

Referenced by encode_createhow4(), and encode_op_create().

◆ encode_createhow4()

static bool_t encode_createhow4 ( XDR xdr,
createhow4 ch 
)
static

Definition at line 1902 of file nfs41_xdr.c.

1905{
1906 bool_t result = TRUE;
1907
1908 if (!xdr_u_int32_t(xdr, &ch->mode))
1909 return FALSE;
1910
1911 switch (ch->mode)
1912 {
1913 case UNCHECKED4:
1914 case GUARDED4:
1916 break;
1917 case EXCLUSIVE4:
1918 result = xdr_opaque(xdr, (char *)ch->createverf, NFS4_VERIFIER_SIZE);
1919 break;
1920 case EXCLUSIVE4_1:
1921 if (!xdr_opaque(xdr, (char *)ch->createverf, NFS4_VERIFIER_SIZE))
1922 return FALSE;
1923 if (!encode_createattrs4(xdr, ch->createattrs))
1924 return FALSE;
1925 break;
1926 }
1927 return result;
1928}
@ GUARDED4
Definition: nfs41_ops.h:541
@ EXCLUSIVE4
Definition: nfs41_ops.h:542
@ UNCHECKED4
Definition: nfs41_ops.h:540
@ EXCLUSIVE4_1
Definition: nfs41_ops.h:543
static bool_t encode_createattrs4(XDR *xdr, nfs41_file_info *createattrs)
Definition: nfs41_xdr.c:1339
unsigned char createverf[NFS4_VERIFIER_SIZE]
Definition: nfs41_ops.h:549
nfs41_file_info * createattrs
Definition: nfs41_ops.h:548
uint32_t mode
Definition: nfs41_ops.h:547

Referenced by encode_openflag4().

◆ encode_createtype4()

static bool_t encode_createtype4 ( XDR xdr,
createtype4 ct 
)
static

Definition at line 1309 of file nfs41_xdr.c.

1312{
1313 bool_t result = TRUE;
1314 const char *linkdata;
1315
1316 if (!xdr_u_int32_t(xdr, &ct->type))
1317 return FALSE;
1318
1319 switch (ct->type)
1320 {
1321 case NF4LNK:
1322 linkdata = ct->u.lnk.linkdata;
1323 result = xdr_bytes(xdr, (char**)&linkdata, &ct->u.lnk.linkdata_len,
1325 break;
1326 case NF4BLK:
1327 case NF4CHR:
1328 result = xdr_u_int32_t(xdr, &ct->u.devdata.specdata1);
1329 if (result == TRUE)
1330 result = xdr_u_int32_t(xdr, &ct->u.devdata.specdata2);
1331 break;
1332 default:
1333 // Some types need no further action
1334 break;
1335 }
1336 return result;
1337}
@ NF4BLK
Definition: nfs41_const.h:296
@ NF4CHR
Definition: nfs41_const.h:297
@ NF4LNK
Definition: nfs41_const.h:298
specdata4 devdata
Definition: nfs41_ops.h:351
uint32_t type
Definition: nfs41_ops.h:343
struct __createtype4::@41::__create_type_lnk lnk
union __createtype4::@41 u
uint32_t specdata1
Definition: nfs41_ops.h:338
uint32_t specdata2
Definition: nfs41_ops.h:339

Referenced by encode_op_create().

◆ encode_file_attrs()

static bool_t encode_file_attrs ( fattr4 attrs,
nfs41_file_info info 
)
static

Definition at line 2566 of file nfs41_xdr.c.

2569{
2570 uint32_t i;
2571 XDR localxdr;
2572
2573 xdrmem_create(&localxdr, (char *)attrs->attr_vals, NFS4_OPAQUE_LIMIT, XDR_ENCODE);
2574
2575 attrs->attr_vals_len = 0;
2576 ZeroMemory(&attrs->attrmask, sizeof(bitmap4));
2577 attrs->attrmask.count = info->attrmask.count;
2578
2579 if (info->attrmask.count > 0) {
2580 if (info->attrmask.arr[0] & FATTR4_WORD0_SIZE) {
2581 if (!xdr_u_hyper(&localxdr, &info->size))
2582 return FALSE;
2583 attrs->attrmask.arr[0] |= FATTR4_WORD0_SIZE;
2584 }
2585 if (info->attrmask.arr[0] & FATTR4_WORD0_ACL) {
2586 if (!xdr_nfsacl41(&localxdr, info->acl))
2587 return FALSE;
2588 attrs->attrmask.arr[0] |= FATTR4_WORD0_ACL;
2589 }
2590 if (info->attrmask.arr[0] & FATTR4_WORD0_ARCHIVE) {
2591 if (!xdr_bool(&localxdr, &info->archive))
2592 return FALSE;
2593 attrs->attrmask.arr[0] |= FATTR4_WORD0_ARCHIVE;
2594 }
2595 if (info->attrmask.arr[0] & FATTR4_WORD0_HIDDEN) {
2596 if (!xdr_bool(&localxdr, &info->hidden))
2597 return FALSE;
2598 attrs->attrmask.arr[0] |= FATTR4_WORD0_HIDDEN;
2599 }
2600 }
2601 if (info->attrmask.count > 1) {
2602 if (info->attrmask.arr[1] & FATTR4_WORD1_MODE) {
2603 if (!xdr_u_int32_t(&localxdr, &info->mode))
2604 return FALSE;
2605 attrs->attrmask.arr[1] |= FATTR4_WORD1_MODE;
2606 }
2607 if (info->attrmask.arr[1] & FATTR4_WORD1_SYSTEM) {
2608 if (!xdr_bool(&localxdr, &info->system))
2609 return FALSE;
2610 attrs->attrmask.arr[1] |= FATTR4_WORD1_SYSTEM;
2611 }
2612 if (info->attrmask.arr[1] & FATTR4_WORD1_TIME_ACCESS_SET) {
2613 if (!xdr_settime4(&localxdr, &info->time_access, info->time_delta))
2614 return FALSE;
2616 }
2617 if (info->attrmask.arr[1] & FATTR4_WORD1_TIME_CREATE) {
2618 if (!xdr_nfstime4(&localxdr, &info->time_create))
2619 return FALSE;
2621 }
2622 if (info->attrmask.arr[1] & FATTR4_WORD1_TIME_MODIFY_SET) {
2623 if (!xdr_settime4(&localxdr, &info->time_modify, info->time_delta))
2624 return FALSE;
2626 }
2627 if (info->attrmask.arr[1] & FATTR4_WORD1_OWNER) {
2628 char *ptr = &info->owner[0];
2629 uint32_t owner_len = (uint32_t)strlen(info->owner);
2630 if (!xdr_bytes(&localxdr, &ptr, &owner_len,
2632 return FALSE;
2633 attrs->attrmask.arr[1] |= FATTR4_WORD1_OWNER;
2634 }
2635 if (info->attrmask.arr[1] & FATTR4_WORD1_OWNER_GROUP) {
2636 char *ptr = &info->owner_group[0];
2637 uint32_t owner_group_len = (uint32_t)strlen(info->owner_group);
2638 if (!xdr_bytes(&localxdr, &ptr, &owner_group_len,
2640 return FALSE;
2642 }
2643 }
2644 if (info->attrmask.count > 2) {
2645 if (info->attrmask.arr[2] & FATTR4_WORD2_MODE_SET_MASKED) {
2646 if (!xdr_u_int32_t(&localxdr, &info->mode))
2647 return FALSE;
2648 if (!xdr_u_int32_t(&localxdr, &info->mode_mask))
2649 return FALSE;
2651 }
2652 }
2653
2654 /* warn if we try to set attributes that aren't handled */
2655 for (i = 0; i < info->attrmask.count; i++)
2656 if (attrs->attrmask.arr[i] != info->attrmask.arr[i])
2657 eprintf("encode_file_attrs() attempted to encode extra "
2658 "attributes in arr[%d]: encoded %d, but wanted %d.\n",
2659 i, attrs->attrmask.arr[i], info->attrmask.arr[i]);
2660
2661 attrs->attr_vals_len = xdr_getpos(&localxdr);
2662 return TRUE;
2663}
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
@ FATTR4_WORD2_MODE_SET_MASKED
Definition: nfs41_const.h:286
@ FATTR4_WORD1_TIME_ACCESS_SET
Definition: nfs41_const.h:260
@ FATTR4_WORD1_TIME_MODIFY_SET
Definition: nfs41_const.h:266
static bool_t xdr_nfsacl41(XDR *xdr, nfsacl41 *acl)
Definition: nfs41_xdr.c:327
static bool_t xdr_settime4(XDR *xdr, nfstime4 *nt, const nfstime4 *time_delta)
Definition: nfs41_xdr.c:113
unsigned int count
Definition: notification.c:64
@ XDR_ENCODE
Definition: xdr.h:85
#define xdr_getpos(xdrs)
Definition: xdr.h:201

Referenced by encode_createattrs4(), and encode_op_setattr().

◆ encode_op_access()

static bool_t encode_op_access ( XDR xdr,
nfs_argop4 argop 
)
static

Definition at line 1195 of file nfs41_xdr.c.

1198{
1200
1201 if (unexpected_op(argop->op, OP_ACCESS))
1202 return FALSE;
1203
1204 return xdr_u_int32_t(xdr, &args->access);
1205}

◆ encode_op_bind_conn_to_session()

static bool_t encode_op_bind_conn_to_session ( XDR xdr,
nfs_argop4 argop 
)
static

Definition at line 876 of file nfs41_xdr.c.

879{
880 uint32_t zero = 0;
881
884
886 return FALSE;
887
888 if (!xdr_opaque(xdr, (char *)args->sessionid, NFS4_SESSIONID_SIZE))
889 return FALSE;
890
891 if (!xdr_enum(xdr, (enum_t *)&args->dir))
892 return FALSE;
893
894 return xdr_u_int32_t(xdr, &zero); /* bctsa_use_conn_in_rdma_mode = false */
895}

◆ encode_op_close()

static bool_t encode_op_close ( XDR xdr,
nfs_argop4 argop 
)
static

Definition at line 1233 of file nfs41_xdr.c.

1236{
1238 uint32_t zero = 0;
1239
1240 if (unexpected_op(argop->op, OP_CLOSE))
1241 return FALSE;
1242
1243 if (!xdr_u_int32_t(xdr, &zero)) // This should be ignored by server
1244 return FALSE;
1245
1246 return xdr_stateid4(xdr, &args->stateid->stateid);
1247}

◆ encode_op_commit()

static bool_t encode_op_commit ( XDR xdr,
nfs_argop4 argop 
)
static

Definition at line 1272 of file nfs41_xdr.c.

1275{
1277
1278 if (unexpected_op(argop->op, OP_COMMIT))
1279 return FALSE;
1280
1281 if (!xdr_u_hyper(xdr, &args->offset))
1282 return FALSE;
1283
1284 return xdr_u_int32_t(xdr, &args->count);
1285}

◆ encode_op_create()

static bool_t encode_op_create ( XDR xdr,
nfs_argop4 argop 
)
static

Definition at line 1353 of file nfs41_xdr.c.

1356{
1358
1359 if (unexpected_op(argop->op, OP_CREATE))
1360 return FALSE;
1361
1362 if (!encode_createtype4(xdr, &args->objtype))
1363 return FALSE;
1364
1365 if (!encode_component(xdr, args->name))
1366 return FALSE;
1367
1368 return encode_createattrs4(xdr, args->createattrs);
1369}
static bool_t encode_createtype4(XDR *xdr, createtype4 *ct)
Definition: nfs41_xdr.c:1309

◆ encode_op_create_session()

static bool_t encode_op_create_session ( XDR xdr,
nfs_argop4 argop 
)
static

Definition at line 798 of file nfs41_xdr.c.

801{
803 nfs41_callback_secparms *cb_secparams = args->csa_cb_secparams;
804 uint32_t cb_count = 2;
805
807 return FALSE;
808
809 /* clientid4 csa_clientid */
810 if (!xdr_u_hyper(xdr, &args->csa_clientid))
811 return FALSE;
812
813 /* sequenceid4 csa_sequence */
814 if (!xdr_u_int32_t(xdr, &args->csa_sequence))
815 return FALSE;
816
817 /* TODO: uint32_t csa_flags = 0 */
818 if (!xdr_u_int32_t(xdr, &args->csa_flags))
819 return FALSE;
820
821 /* channel_attrs4 csa_fore_chan_attrs */
822 if (!xdr_channel_attrs4(xdr, &args->csa_fore_chan_attrs))
823 return FALSE;
824
825 /* channel_attrs4 csa_back_chan_attrs */
826 if (!xdr_channel_attrs4(xdr, &args->csa_back_chan_attrs))
827 return FALSE;
828
829 /* TODO: uint32_t csa_cb_program = 1234 */
830 if (!xdr_u_int32_t(xdr, &args->csa_cb_program))
831 return FALSE;
832
833 return xdr_array(xdr, (char **)&cb_secparams, &cb_count,
835}
static WORD cb_count
Definition: loader.c:52
static bool_t encode_backchannel_sec_parms(XDR *xdr, nfs41_callback_secparms *args)
Definition: nfs41_xdr.c:774

◆ encode_op_delegpurge()

static bool_t encode_op_delegpurge ( XDR xdr,
nfs_argop4 argop 
)
static

Definition at line 1636 of file nfs41_xdr.c.

1639{
1640 uint64_t zero = 0;
1641
1642 if (unexpected_op(argop->op, OP_DELEGPURGE))
1643 return FALSE;
1644
1645 /* The client SHOULD set the client field to zero,
1646 * and the server MUST ignore the clientid field. */
1647 return xdr_u_int64_t(xdr, &zero);
1648}
bool_t xdr_u_int64_t(XDR *xdrs, u_int64_t *ullp)
Definition: xdr.c:828

◆ encode_op_delegreturn()

static bool_t encode_op_delegreturn ( XDR xdr,
nfs_argop4 argop 
)
static

Definition at line 1666 of file nfs41_xdr.c.

1669{
1671
1673 return FALSE;
1674
1675 return xdr_stateid4(xdr, &args->stateid->stateid);
1676}

◆ encode_op_destroy_clientid()

static bool_t encode_op_destroy_clientid ( XDR xdr,
nfs_argop4 argop 
)
static

Definition at line 955 of file nfs41_xdr.c.

958{
960
962 return FALSE;
963
964 return xdr_u_hyper(xdr, &args->dca_clientid);
965}

◆ encode_op_destroy_session()

static bool_t encode_op_destroy_session ( XDR xdr,
nfs_argop4 argop 
)
static

Definition at line 928 of file nfs41_xdr.c.

931{
933
935 return FALSE;
936
937 return xdr_opaque(xdr, (char *)args->dsa_sessionid, NFS4_SESSIONID_SIZE);
938}

◆ encode_op_exchange_id()

static bool_t encode_op_exchange_id ( XDR xdr,
nfs_argop4 argop 
)
static

Definition at line 551 of file nfs41_xdr.c.

554{
555 uint32_t zero = 0;
556 uint32_t one = 1;
557
559
561 return FALSE;
562
563 if (!xdr_client_owner4(xdr, args->eia_clientowner))
564 return FALSE;
565
566 if (!xdr_u_int32_t(xdr, &args->eia_flags))
567 return FALSE;
568
569 if (!xdr_state_protect4_a(xdr, &args->eia_state_protect))
570 return FALSE;
571
572 if (args->eia_client_impl_id)
573 {
574 if (!xdr_u_int32_t(xdr, &one))
575 return FALSE;
576 return xdr_nfs_impl_id4(xdr, args->eia_client_impl_id);
577 }
578 else
579 return xdr_u_int32_t(xdr, &zero);
580}
static bool_t xdr_state_protect4_a(XDR *xdr, state_protect4_a *spa)
Definition: nfs41_xdr.c:504
static bool_t xdr_nfs_impl_id4(XDR *xdr, nfs_impl_id4 *nii)
Definition: nfs41_xdr.c:534
static bool_t xdr_client_owner4(XDR *xdr, client_owner4 *co)
Definition: nfs41_xdr.c:460
int one
Definition: sehframes.cpp:28

◆ encode_op_free_stateid()

static bool_t encode_op_free_stateid ( XDR xdr,
nfs_argop4 argop 
)
static

Definition at line 2766 of file nfs41_xdr.c.

2769{
2771
2773 return FALSE;
2774
2775 return xdr_stateid4(xdr, args->stateid);
2776}

◆ encode_op_getattr()

static bool_t encode_op_getattr ( XDR xdr,
nfs_argop4 argop 
)
static

Definition at line 1694 of file nfs41_xdr.c.

1697{
1699
1700 if (unexpected_op(argop->op, OP_GETATTR))
1701 return FALSE;
1702
1703 return xdr_bitmap4(xdr, args->attr_request);
1704}

◆ encode_op_getdeviceinfo()

static bool_t encode_op_getdeviceinfo ( XDR xdr,
nfs_argop4 argop 
)
static

Definition at line 2985 of file nfs41_xdr.c.

2988{
2990
2992 return FALSE;
2993
2994 if (!xdr_opaque(xdr, (char *)args->deviceid, PNFS_DEVICEID_SIZE))
2995 return FALSE;
2996
2997 if (!xdr_enum(xdr, (enum_t *)&args->layout_type))
2998 return FALSE;
2999
3000 if (!xdr_u_int32_t(xdr, &args->maxcount))
3001 return FALSE;
3002
3003 return xdr_bitmap4(xdr, &args->notify_types);
3004}

◆ encode_op_getfh()

static bool_t encode_op_getfh ( XDR xdr,
nfs_argop4 argop 
)
static

Definition at line 1134 of file nfs41_xdr.c.

1137{
1138 if (unexpected_op(argop->op, OP_GETFH))
1139 return FALSE;
1140
1141 /* void */
1142 return TRUE;
1143}

◆ encode_op_layoutcommit()

static bool_t encode_op_layoutcommit ( XDR xdr,
nfs_argop4 argop 
)
static

Definition at line 3181 of file nfs41_xdr.c.

3184{
3186 bool_t false_bool = FALSE;
3187 bool_t true_bool = TRUE;
3189 uint32_t zero = 0;
3190
3192 return FALSE;
3193
3194 if (!xdr_u_hyper(xdr, &args->offset))
3195 return FALSE;
3196
3197 if (!xdr_u_hyper(xdr, &args->length))
3198 return FALSE;
3199
3200 if (!xdr_bool(xdr, &false_bool)) /* loca_reclaim = 0 */
3201 return FALSE;
3202
3203 if (!xdr_stateid4(xdr, args->stateid))
3204 return FALSE;
3205
3206 /* loca_last_write_offset */
3207 if (args->new_offset) {
3208 if (!xdr_bool(xdr, &true_bool))
3209 return FALSE;
3210
3211 if (!xdr_u_hyper(xdr, args->new_offset))
3212 return FALSE;
3213 } else {
3214 if (!xdr_bool(xdr, &false_bool))
3215 return FALSE;
3216 }
3217
3218 /* loca_time_modify */
3219 if (args->new_time) {
3220 if (!xdr_bool(xdr, &true_bool))
3221 return FALSE;
3222
3223 if (!xdr_nfstime4(xdr, args->new_time))
3224 return FALSE;
3225 } else {
3226 if (!xdr_bool(xdr, &false_bool))
3227 return FALSE;
3228 }
3229
3230 /* loca_layoutupdate */
3231 if (!xdr_enum(xdr, &pnfs_layout))
3232 return FALSE;
3233
3234 return xdr_u_int32_t(xdr, &zero);
3235}
int length
Definition: match.c:394

◆ encode_op_layoutget()

static bool_t encode_op_layoutget ( XDR xdr,
nfs_argop4 argop 
)
static

Definition at line 3263 of file nfs41_xdr.c.

3266{
3268
3269 if (unexpected_op(argop->op, OP_LAYOUTGET))
3270 return FALSE;
3271
3272 if (!xdr_bool(xdr, &args->signal_layout_avail))
3273 return FALSE;
3274
3275 if (!xdr_u_int32_t(xdr, (u_int32_t *)&args->layout_type))
3276 return FALSE;
3277
3278 if (!xdr_u_int32_t(xdr, (u_int32_t *)&args->iomode))
3279 return FALSE;
3280
3281 if (!xdr_u_hyper(xdr, &args->offset))
3282 return FALSE;
3283
3284 if (!xdr_u_hyper(xdr, &args->length))
3285 return FALSE;
3286
3287 if (!xdr_u_hyper(xdr, &args->minlength))
3288 return FALSE;
3289
3290 if (!xdr_stateid4(xdr, &args->stateid->stateid))
3291 return FALSE;
3292
3293 return xdr_u_int32_t(xdr, &args->maxcount);
3294}

◆ encode_op_layoutreturn()

static bool_t encode_op_layoutreturn ( XDR xdr,
nfs_argop4 argop 
)
static

Definition at line 3441 of file nfs41_xdr.c.

3444{
3446
3448 return FALSE;
3449
3450 if (!xdr_bool(xdr, &args->reclaim))
3451 return FALSE;
3452
3453 if (!xdr_enum(xdr, (enum_t *)&args->type))
3454 return FALSE;
3455
3456 if (!xdr_enum(xdr, (enum_t *)&args->iomode))
3457 return FALSE;
3458
3459 if (!xdr_enum(xdr, (enum_t *)&args->return_type))
3460 return FALSE;
3461
3462 if (args->return_type == PNFS_RETURN_FILE) {
3463 u_int32_t zero = 0;
3464
3465 if (!xdr_u_hyper(xdr, &args->offset))
3466 return FALSE;
3467
3468 if (!xdr_u_hyper(xdr, &args->length))
3469 return FALSE;
3470
3471 if (!xdr_stateid4(xdr, args->stateid))
3472 return FALSE;
3473
3474 return xdr_u_int32_t(xdr, &zero); /* size of lrf_body is 0 */
3475 } else {
3476 eprintf("%s: layout type (%d) is not PNFS_RETURN_FILE!\n",
3477 "encode_op_layoutreturn", args->return_type);
3478 return FALSE;
3479 }
3480}
@ PNFS_RETURN_FILE
Definition: pnfs.h:101

◆ encode_op_link()

static bool_t encode_op_link ( XDR xdr,
nfs_argop4 argop 
)
static

Definition at line 1409 of file nfs41_xdr.c.

1412{
1414
1415 if (unexpected_op(argop->op, OP_LINK))
1416 return FALSE;
1417
1418 return encode_component(xdr, args->newname);
1419}

◆ encode_op_lock()

static bool_t encode_op_lock ( XDR xdr,
nfs_argop4 argop 
)
static

Definition at line 1477 of file nfs41_xdr.c.

1480{
1482
1483 if (unexpected_op(argop->op, OP_LOCK))
1484 return FALSE;
1485
1486 if (!xdr_u_int32_t(xdr, &args->locktype))
1487 return FALSE;
1488
1489 if (!xdr_bool(xdr, &args->reclaim))
1490 return FALSE;
1491
1492 if (!xdr_u_hyper(xdr, &args->offset))
1493 return FALSE;
1494
1495 if (!xdr_u_hyper(xdr, &args->length))
1496 return FALSE;
1497
1498 return xdr_locker4(xdr, &args->locker);
1499}
static bool_t xdr_locker4(XDR *xdr, locker4 *locker)
Definition: nfs41_xdr.c:1443

◆ encode_op_lockt()

static bool_t encode_op_lockt ( XDR xdr,
nfs_argop4 argop 
)
static

Definition at line 1547 of file nfs41_xdr.c.

1550{
1552
1553 if (unexpected_op(argop->op, OP_LOCKT))
1554 return FALSE;
1555
1556 if (!xdr_u_int32_t(xdr, &args->locktype))
1557 return FALSE;
1558
1559 if (!xdr_u_hyper(xdr, &args->offset))
1560 return FALSE;
1561
1562 if (!xdr_u_hyper(xdr, &args->length))
1563 return FALSE;
1564
1565 return xdr_state_owner4(xdr, args->owner);
1566}

◆ encode_op_locku()

static bool_t encode_op_locku ( XDR xdr,
nfs_argop4 argop 
)
static

Definition at line 1590 of file nfs41_xdr.c.

1593{
1595
1596 if (unexpected_op(argop->op, OP_LOCKU))
1597 return FALSE;
1598
1599 if (!xdr_u_int32_t(xdr, &args->locktype))
1600 return FALSE;
1601
1602 if (!xdr_u_int32_t(xdr, &args->seqid))
1603 return FALSE;
1604
1605 if (!xdr_stateid4(xdr, &args->lock_stateid->stateid))
1606 return FALSE;
1607
1608 if (!xdr_u_hyper(xdr, &args->offset))
1609 return FALSE;
1610
1611 return xdr_u_hyper(xdr, &args->length);
1612}

◆ encode_op_lookup()

static bool_t encode_op_lookup ( XDR xdr,
nfs_argop4 argop 
)
static

Definition at line 1167 of file nfs41_xdr.c.

1170{
1172
1173 if (unexpected_op(argop->op, OP_LOOKUP))
1174 return FALSE;
1175
1176 return encode_component(xdr, args->name);
1177}

◆ encode_op_open()

static bool_t encode_op_open ( XDR xdr,
nfs_argop4 argop 
)
static

Definition at line 1993 of file nfs41_xdr.c.

1996{
1998
1999 if (unexpected_op(argop->op, OP_OPEN))
2000 return FALSE;
2001
2002 if (!xdr_u_int32_t(xdr, &args->seqid))
2003 return FALSE;
2004
2005 if (!xdr_u_int32_t(xdr, &args->share_access))
2006 return FALSE;
2007
2008 if (!xdr_u_int32_t(xdr, &args->share_deny))
2009 return FALSE;
2010
2011 if (!xdr_state_owner4(xdr, args->owner))
2012 return FALSE;
2013
2014 if (!encode_openflag4(xdr, &args->openhow))
2015 return FALSE;
2016
2017 return encode_open_claim4(xdr, args->claim);
2018}
static bool_t encode_openflag4(XDR *xdr, openflag4 *of)
Definition: nfs41_xdr.c:1930
static bool_t encode_open_claim4(XDR *xdr, open_claim4 *oc)
Definition: nfs41_xdr.c:1960

◆ encode_op_openattr()

static bool_t encode_op_openattr ( XDR xdr,
nfs_argop4 argop 
)
static

Definition at line 2171 of file nfs41_xdr.c.

2174{
2176
2177 if (unexpected_op(argop->op, OP_OPENATTR))
2178 return FALSE;
2179
2180 return xdr_bool(xdr, &args->createdir);
2181}

◆ encode_op_putfh()

static bool_t encode_op_putfh ( XDR xdr,
nfs_argop4 argop 
)
static

Definition at line 1080 of file nfs41_xdr.c.

1083{
1085
1086 if (unexpected_op(argop->op, OP_PUTFH))
1087 return FALSE;
1088
1089 return xdr_fh(xdr, &args->file->fh);
1090}

◆ encode_op_putrootfh()

static bool_t encode_op_putrootfh ( XDR xdr,
nfs_argop4 argop 
)
static

Definition at line 1108 of file nfs41_xdr.c.

1111{
1112 if (unexpected_op(argop->op, OP_PUTROOTFH))
1113 return FALSE;
1114 /* void */
1115 return TRUE;
1116}

◆ encode_op_read()

static bool_t encode_op_read ( XDR xdr,
nfs_argop4 argop 
)
static

Definition at line 2199 of file nfs41_xdr.c.

2202{
2204
2205 if (unexpected_op(argop->op, OP_READ))
2206 return FALSE;
2207
2208 if (!xdr_stateid4(xdr, &args->stateid->stateid))
2209 return FALSE;
2210
2211 if (!xdr_u_hyper(xdr, &args->offset))
2212 return FALSE;
2213
2214 return xdr_u_int32_t(xdr, &args->count);
2215}

◆ encode_op_readdir()

static bool_t encode_op_readdir ( XDR xdr,
nfs_argop4 argop 
)
static

Definition at line 2251 of file nfs41_xdr.c.

2254{
2256
2257 if (unexpected_op(argop->op, OP_READDIR))
2258 return FALSE;
2259
2260 if (!xdr_u_hyper(xdr, &args->cookie.cookie))
2261 return FALSE;
2262
2263 if (!xdr_opaque(xdr, (char *)args->cookie.verf, NFS4_VERIFIER_SIZE))
2264 return FALSE;
2265
2266 if (!xdr_u_int32_t(xdr, &args->dircount))
2267 return FALSE;
2268
2269 if (!xdr_u_int32_t(xdr, &args->maxcount))
2270 return FALSE;
2271
2272 return xdr_bitmap4(xdr, args->attr_request);
2273}

◆ encode_op_readlink()

static bool_t encode_op_readlink ( XDR xdr,
nfs_argop4 argop 
)
static

Definition at line 2403 of file nfs41_xdr.c.

2406{
2407 if (unexpected_op(argop->op, OP_READLINK))
2408 return FALSE;
2409
2410 /* void */
2411 return TRUE;
2412}

◆ encode_op_reclaim_complete()

static bool_t encode_op_reclaim_complete ( XDR xdr,
nfs_argop4 argop 
)
static

Definition at line 1051 of file nfs41_xdr.c.

1054{
1055 bool_t zero = FALSE;
1056
1058 return FALSE;
1059
1060 /* rca_one_fs = 0 indicates that the reclaim applies to all filesystems */
1061 return xdr_bool(xdr, &zero);
1062}

◆ encode_op_remove()

static bool_t encode_op_remove ( XDR xdr,
nfs_argop4 argop 
)
static

Definition at line 2438 of file nfs41_xdr.c.

2441{
2443
2444 if (unexpected_op(argop->op, OP_REMOVE))
2445 return FALSE;
2446
2447 return encode_component(xdr, args->target);
2448}

◆ encode_op_rename()

static bool_t encode_op_rename ( XDR xdr,
nfs_argop4 argop 
)
static

Definition at line 2472 of file nfs41_xdr.c.

2475{
2477
2478 if (unexpected_op(argop->op, OP_RENAME))
2479 return FALSE;
2480
2481 if (!encode_component(xdr, args->oldname))
2482 return FALSE;
2483
2484 return encode_component(xdr, args->newname);
2485}

◆ encode_op_restorefh()

static bool_t encode_op_restorefh ( XDR xdr,
nfs_argop4 argop 
)
static

Definition at line 2512 of file nfs41_xdr.c.

2515{
2516 if (unexpected_op(argop->op, OP_RESTOREFH))
2517 return FALSE;
2518
2519 /* void */
2520 return TRUE;
2521}

◆ encode_op_savefh()

static bool_t encode_op_savefh ( XDR xdr,
nfs_argop4 argop 
)
static

Definition at line 2539 of file nfs41_xdr.c.

2542{
2543 if (unexpected_op(argop->op, OP_SAVEFH))
2544 return FALSE;
2545
2546 /* void */
2547 return TRUE;
2548}

◆ encode_op_secinfo()

static bool_t encode_op_secinfo ( XDR xdr,
nfs_argop4 argop 
)
static

Definition at line 2948 of file nfs41_xdr.c.

2951{
2953
2954 if (unexpected_op(argop->op, OP_SECINFO))
2955 return FALSE;
2956
2957 if (!encode_component(xdr, args->name))
2958 return FALSE;
2959
2960 return TRUE;
2961}

◆ encode_op_secinfo_noname()

static bool_t encode_op_secinfo_noname ( XDR xdr,
nfs_argop4 argop 
)
static

Definition at line 2911 of file nfs41_xdr.c.

2914{
2916
2918 return FALSE;
2919
2920 if (!xdr_enum(xdr, (enum_t *)&args->type))
2921 return FALSE;
2922
2923 return TRUE;
2924}

◆ encode_op_sequence()

static bool_t encode_op_sequence ( XDR xdr,
nfs_argop4 argop 
)
static

Definition at line 983 of file nfs41_xdr.c.

986{
988
989 if (unexpected_op(argop->op, OP_SEQUENCE))
990 return FALSE;
991
992 if (!xdr_opaque(xdr, (char *)args->sa_sessionid, NFS4_SESSIONID_SIZE))
993 return FALSE;
994
995 if (!xdr_u_int32_t(xdr, &args->sa_sequenceid))
996 return FALSE;
997
998 if (!xdr_u_int32_t(xdr, &args->sa_slotid))
999 return FALSE;
1000
1001 if (!xdr_u_int32_t(xdr, &args->sa_highest_slotid))
1002 return FALSE;
1003
1004 return xdr_bool(xdr, &args->sa_cachethis);
1005}

◆ encode_op_setattr()

static bool_t encode_op_setattr ( XDR xdr,
nfs_argop4 argop 
)
static

Definition at line 2665 of file nfs41_xdr.c.

2668{
2670 fattr4 attrs;
2671
2672 if (unexpected_op(argop->op, OP_SETATTR))
2673 return FALSE;
2674
2675 if (!xdr_stateid4(xdr, &args->stateid->stateid))
2676 return FALSE;
2677
2678 /* encode attribute values from args->info into attrs.attr_vals */
2679 attrs.attr_vals_len = NFS4_OPAQUE_LIMIT;
2680 if (!encode_file_attrs(&attrs, args->info))
2681 return FALSE;
2682
2683 return xdr_fattr4(xdr, &attrs);
2684}

◆ encode_op_test_stateid()

static bool_t encode_op_test_stateid ( XDR xdr,
nfs_argop4 argop 
)
static

Definition at line 2794 of file nfs41_xdr.c.

2797{
2799
2801 return FALSE;
2802
2803 return xdr_array(xdr, (char**)&args->stateids, &args->count,
2804 args->count, sizeof(stateid_arg), (xdrproc_t)xdr_stateid4);
2805}

◆ encode_op_want_delegation()

static bool_t encode_op_want_delegation ( XDR xdr,
nfs_argop4 argop 
)
static

Definition at line 2708 of file nfs41_xdr.c.

2711{
2713
2715 return FALSE;
2716
2717 if (!xdr_u_int32_t(xdr, &args->want))
2718 return FALSE;
2719
2720 if (!xdr_u_int32_t(xdr, &args->claim->claim))
2721 return FALSE;
2722
2723 return args->claim->claim != CLAIM_PREVIOUS ||
2724 xdr_u_int32_t(xdr, &args->claim->prev_delegate_type);
2725}
@ CLAIM_PREVIOUS
Definition: nfs41_ops.h:594

◆ encode_op_write()

static bool_t encode_op_write ( XDR xdr,
nfs_argop4 argop 
)
static

Definition at line 2830 of file nfs41_xdr.c.

2833{
2835 unsigned char *data = args->data;
2836
2837 if (unexpected_op(argop->op, OP_WRITE))
2838 return FALSE;
2839
2840 if (!xdr_stateid4(xdr, &args->stateid->stateid))
2841 return FALSE;
2842
2843 if (!xdr_u_hyper(xdr, &args->offset))
2844 return FALSE;
2845
2846 if (!xdr_u_int32_t(xdr, &args->stable))
2847 return FALSE;
2848
2849 return xdr_bytes(xdr, (char **)&data, &args->data_len, NFS41_MAX_FILEIO_SIZE);
2850}

◆ encode_open_claim4()

static bool_t encode_open_claim4 ( XDR xdr,
open_claim4 oc 
)
static

Definition at line 1960 of file nfs41_xdr.c.

1963{
1964 if (!xdr_u_int32_t(xdr, &oc->claim))
1965 return FALSE;
1966
1967 switch (oc->claim)
1968 {
1969 case CLAIM_NULL:
1970 return encode_component(xdr, oc->u.null.filename);
1971 case CLAIM_PREVIOUS:
1972 return xdr_u_int32_t(xdr, &oc->u.prev.delegate_type);
1973 case CLAIM_FH:
1974 return TRUE; /* use current file handle */
1975 case CLAIM_DELEGATE_CUR:
1976 return encode_claim_deleg_cur(xdr,
1977 &oc->u.deleg_cur.delegate_stateid->stateid,
1978 oc->u.deleg_cur.name);
1979 case CLAIM_DELEG_CUR_FH:
1980 return xdr_stateid4(xdr,
1981 &oc->u.deleg_cur_fh.delegate_stateid->stateid);
1983 return encode_component(xdr, oc->u.deleg_prev.filename);
1985 return TRUE; /* use current file handle */
1986 default:
1987 eprintf("encode_open_claim4: unsupported claim %d.\n",
1988 oc->claim);
1989 return FALSE;
1990 }
1991}
@ CLAIM_NULL
Definition: nfs41_ops.h:593
@ CLAIM_DELEG_CUR_FH
Definition: nfs41_ops.h:598
@ CLAIM_DELEGATE_CUR
Definition: nfs41_ops.h:595
@ CLAIM_FH
Definition: nfs41_ops.h:597
@ CLAIM_DELEGATE_PREV
Definition: nfs41_ops.h:596
@ CLAIM_DELEG_PREV_FH
Definition: nfs41_ops.h:599
static bool_t encode_claim_deleg_cur(XDR *xdr, stateid4 *stateid, nfs41_component *name)
Definition: nfs41_xdr.c:1950
uint32_t claim
Definition: nfs41_ops.h:615
struct __open_claim4::@44::__open_claim_null null
struct __open_claim4::@44::__open_claim_deleg_cur_fh deleg_cur_fh
struct __open_claim4::@44::__open_claim_deleg_cur deleg_cur
struct __open_claim4::@44::__open_claim_prev prev
struct __open_claim4::@44::__open_claim_deleg_prev deleg_prev
union __open_claim4::@44 u

Referenced by encode_op_open().

◆ encode_openflag4()

static bool_t encode_openflag4 ( XDR xdr,
openflag4 of 
)
static

Definition at line 1930 of file nfs41_xdr.c.

1933{
1934 bool_t result = TRUE;
1935
1936 if (!xdr_u_int32_t(xdr, &of->opentype))
1937 return FALSE;
1938
1939 switch (of->opentype)
1940 {
1941 case OPEN4_CREATE:
1942 result = encode_createhow4(xdr, &of->how);
1943 break;
1944 default:
1945 break;
1946 }
1947 return result;
1948}
@ OPEN4_CREATE
Definition: nfs41_ops.h:554
static bool_t encode_createhow4(XDR *xdr, createhow4 *ch)
Definition: nfs41_xdr.c:1902
createhow4 how
Definition: nfs41_ops.h:560
uint32_t opentype
Definition: nfs41_ops.h:558

Referenced by encode_op_open().

◆ nfs_decode_compound()

bool_t nfs_decode_compound ( XDR xdr,
caddr_t pres 
)

Definition at line 3625 of file nfs41_xdr.c.

3628{
3630 uint32_t i, expected_count, expected_op;
3631 const op_table_entry *entry;
3632 unsigned char *tag = res->tag;
3633
3634 if (!xdr_u_int32_t(xdr, &res->status))
3635 return FALSE;
3636
3637 if (!xdr_bytes(xdr, (char **)&tag, &res->tag_len, NFS4_OPAQUE_LIMIT))
3638 return FALSE;
3639
3640 expected_count = res->resarray_count;
3641 if (!xdr_u_int32_t(xdr, &res->resarray_count))
3642 return FALSE;
3643
3644 /* validate the number of operations against what we sent */
3645 if (res->resarray_count > expected_count) {
3646 eprintf("reply with %u operations, only sent %u!\n",
3647 res->resarray_count, expected_count);
3648 return FALSE;
3649 } else if (res->resarray_count < expected_count &&
3650 res->status == NFS4_OK) {
3651 /* illegal for a server to reply with less operations,
3652 * unless one of them fails */
3653 eprintf("successful reply with only %u operations, sent %u!\n",
3654 res->resarray_count, expected_count);
3655 return FALSE;
3656 }
3657
3658 for (i = 0; i < res->resarray_count; i++)
3659 {
3660 expected_op = res->resarray[i].op;
3661 if (!xdr_u_int32_t(xdr, &res->resarray[i].op))
3662 return FALSE;
3663
3664 /* validate each operation number against what we sent */
3665 if (res->resarray[i].op != expected_op) {
3666 eprintf("reply with %s in operation %u, expected %s!\n",
3667 nfs_opnum_to_string(res->resarray[i].op), i+1,
3668 nfs_opnum_to_string(expected_op));
3669 return FALSE;
3670 }
3671
3672 entry = op_table_find(res->resarray[i].op);
3673 if (entry == NULL || entry->decode == NULL)
3674 return FALSE;
3675 if (!entry->decode(xdr, &res->resarray[i]))
3676 return FALSE;
3677 }
3678 return TRUE;
3679}
const char * nfs_opnum_to_string(int opnum)
Definition: daemon_debug.c:305
static int expected_count(int *sink)
static const op_table_entry * op_table_find(uint32_t op)
Definition: nfs41_xdr.c:3582
Definition: nfs41_xdr.c:3509
Definition: ecma_167.h:138

Referenced by nfs41_send_compound().

◆ nfs_encode_compound()

bool_t nfs_encode_compound ( XDR xdr,
caddr_t pargs 
)

Definition at line 3591 of file nfs41_xdr.c.

3594{
3595 unsigned char *tag;
3596
3598 uint32_t i;
3599 const op_table_entry *entry;
3600
3601 tag = args->tag;
3602 if (!xdr_bytes(xdr, (char **)&tag, &args->tag_len, NFS4_OPAQUE_LIMIT))
3603 return FALSE;
3604
3605 if (!xdr_u_int32_t(xdr, &args->minorversion))
3606 return FALSE;
3607
3608 if (!xdr_u_int32_t(xdr, &args->argarray_count))
3609 return FALSE;
3610
3611 for (i = 0; i < args->argarray_count; i++)
3612 {
3613 entry = op_table_find(args->argarray[i].op);
3614 if (entry == NULL || entry->encode == NULL)
3615 return FALSE;
3616
3617 if (!xdr_u_int32_t(xdr, &args->argarray[i].op))
3618 return FALSE;
3619 if (!entry->encode(xdr, &args->argarray[i]))
3620 return FALSE;
3621 }
3622 return TRUE;
3623}

Referenced by nfs41_send_compound().

◆ nfsacl41_free()

void nfsacl41_free ( nfsacl41 acl)

Definition at line 335 of file nfs41_xdr.c.

336{
337 XDR xdr = { XDR_FREE };
338 xdr_nfsacl41(&xdr, acl);
339}
@ XDR_FREE
Definition: xdr.h:87

Referenced by handle_getacl().

◆ op_table_find()

static const op_table_entry * op_table_find ( uint32_t  op)
static

Definition at line 3582 of file nfs41_xdr.c.

3583{
3584 return op >= g_op_table_size ? NULL : &g_op_table[op];
3585}
UINT op
Definition: effect.c:236
static const uint32_t g_op_table_size
Definition: nfs41_xdr.c:3579
static const op_table_entry g_op_table[]
Definition: nfs41_xdr.c:3515

Referenced by nfs_decode_compound(), and nfs_encode_compound().

◆ settime_how()

static uint32_t settime_how ( nfstime4 newtime,
const nfstime4 time_delta 
)
static

Definition at line 98 of file nfs41_xdr.c.

101{
104 /* get the absolute difference between current and newtime */
105 nfstime_diff(&current, newtime, &current);
107 /* compare the difference with time_delta */
108 nfstime_diff(time_delta, &current, &current);
109 /* use client time if diff > delta (i.e. time_delta - current < 0) */
110 return current.seconds < 0 ? SET_TO_CLIENT_TIME4 : SET_TO_SERVER_TIME4;
111}
void get_nfs_time(OUT nfstime4 *nfs_time)
Definition: util.c:210
static __inline void nfstime_diff(IN const nfstime4 *lhs, IN const nfstime4 *rhs, OUT nfstime4 *result)
Definition: util.h:148
static __inline void nfstime_abs(IN const nfstime4 *nt, OUT nfstime4 *result)
Definition: util.h:158
struct task_struct * current
Definition: linux.c:32
@ SET_TO_SERVER_TIME4
Definition: nfs41_ops.h:777
@ SET_TO_CLIENT_TIME4
Definition: nfs41_ops.h:778

Referenced by xdr_settime4().

◆ unexpected_op()

static __inline int unexpected_op ( uint32_t  op,
uint32_t  expected 
)
static

Definition at line 36 of file nfs41_xdr.c.

37{
38 if (op == expected)
39 return 0;
40
41 eprintf("Op table mismatch. Got %s (%d), expected %s (%d).\n",
44 return 1;
45}
BOOL expected
Definition: store.c:2063

Referenced by decode_op_access(), decode_op_bind_conn_to_session(), decode_op_close(), decode_op_commit(), decode_op_create(), decode_op_create_session(), decode_op_delegpurge(), decode_op_delegreturn(), decode_op_destroy_clientid(), decode_op_destroy_session(), decode_op_exchange_id(), decode_op_free_stateid(), decode_op_getattr(), decode_op_getdeviceinfo(), decode_op_getfh(), decode_op_layoutcommit(), decode_op_layoutget(), decode_op_layoutreturn(), decode_op_link(), decode_op_lock(), decode_op_lockt(), decode_op_locku(), decode_op_lookup(), decode_op_open(), decode_op_openattr(), decode_op_putfh(), decode_op_putrootfh(), decode_op_read(), decode_op_readdir(), decode_op_readlink(), decode_op_reclaim_complete(), decode_op_remove(), decode_op_rename(), decode_op_restorefh(), decode_op_savefh(), decode_op_secinfo(), decode_op_secinfo_noname(), decode_op_sequence(), decode_op_setattr(), decode_op_test_stateid(), decode_op_want_delegation(), decode_op_write(), encode_op_access(), encode_op_bind_conn_to_session(), encode_op_close(), encode_op_commit(), encode_op_create(), encode_op_create_session(), encode_op_delegpurge(), encode_op_delegreturn(), encode_op_destroy_clientid(), encode_op_destroy_session(), encode_op_exchange_id(), encode_op_free_stateid(), encode_op_getattr(), encode_op_getdeviceinfo(), encode_op_getfh(), encode_op_layoutcommit(), encode_op_layoutget(), encode_op_layoutreturn(), encode_op_link(), encode_op_lock(), encode_op_lockt(), encode_op_locku(), encode_op_lookup(), encode_op_open(), encode_op_openattr(), encode_op_putfh(), encode_op_putrootfh(), encode_op_read(), encode_op_readdir(), encode_op_readlink(), encode_op_reclaim_complete(), encode_op_remove(), encode_op_rename(), encode_op_restorefh(), encode_op_savefh(), encode_op_secinfo(), encode_op_secinfo_noname(), encode_op_sequence(), encode_op_setattr(), encode_op_test_stateid(), encode_op_want_delegation(), and encode_op_write().

◆ xdr_bitmap4()

bool_t xdr_bitmap4 ( XDR xdr,
bitmap4 bitmap 
)

Definition at line 48 of file nfs41_xdr.c.

51{
52 uint32_t i;
53
54 if (xdr->x_op == XDR_ENCODE) {
55 if (bitmap->count > 3) {
56 eprintf("encode_bitmap4: count (%d) must be <= 3\n",
57 bitmap->count);
58 return FALSE;
59 }
60 if (!xdr_u_int32_t(xdr, &bitmap->count))
61 return FALSE;
62
63 for (i = 0; i < bitmap->count; i++)
64 if (!xdr_u_int32_t(xdr, &bitmap->arr[i]))
65 return FALSE;
66
67 } else if (xdr->x_op == XDR_DECODE) {
68 if (!xdr_u_int32_t(xdr, &bitmap->count))
69 return FALSE;
70 if (bitmap->count > 3) {
71 eprintf("decode_bitmap4: count (%d) must be <= 3\n",
72 bitmap->count);
73 return FALSE;
74 }
75
76 for (i = 0; i < bitmap->count; i++)
77 if (!xdr_u_int32_t(xdr, &bitmap->arr[i]))
78 return FALSE;
79 } else
80 return FALSE;
81
82 return TRUE;
83}
enum xdr_op x_op
Definition: xdr.h:104
Definition: uimain.c:89

Referenced by common_notify4(), decode_file_attrs(), decode_getdeviceinfo_ok(), decode_op_create(), decode_op_setattr(), decode_open_res_ok(), encode_op_getattr(), encode_op_getdeviceinfo(), encode_op_readdir(), op_cb_getattr_args(), xdr_fattr4(), and xdr_threshold_item().

◆ xdr_change_info4()

static bool_t xdr_change_info4 ( XDR xdr,
change_info4 cinfo 
)
static

Definition at line 1371 of file nfs41_xdr.c.

1374{
1375 if (!xdr_bool(xdr, &cinfo->atomic))
1376 return FALSE;
1377
1378 if (!xdr_u_hyper(xdr, &cinfo->before))
1379 return FALSE;
1380
1381 return xdr_u_hyper(xdr, &cinfo->after);
1382}
uint64_t after
Definition: nfs41_types.h:168
uint64_t before
Definition: nfs41_types.h:167

Referenced by decode_op_create(), decode_op_link(), decode_op_remove(), decode_op_rename(), and decode_open_res_ok().

◆ xdr_channel_attrs4()

static bool_t xdr_channel_attrs4 ( XDR xdr,
nfs41_channel_attrs attrs 
)
static

Definition at line 710 of file nfs41_xdr.c.

713{
714 uint32_t zero = 0;
715 uint32_t one = 1;
716
717 /* count4 ca_headerpadsize */
718 if (!xdr_u_int32_t(xdr, &attrs->ca_headerpadsize))
719 return FALSE;
720
721 /* count4 ca_maxrequestsize */
722 if (!xdr_u_int32_t(xdr, &attrs->ca_maxrequestsize))
723 return FALSE;
724
725 /* count4 ca_maxresponsesize */
726 if (!xdr_u_int32_t(xdr, &attrs->ca_maxresponsesize))
727 return FALSE;
728
729 /* count4 ca_maxresponsesize_cached */
730 if (!xdr_u_int32_t(xdr, &attrs->ca_maxresponsesize_cached))
731 return FALSE;
732
733 /* count4 ca_maxoperations */
734 if (!xdr_u_int32_t(xdr, &attrs->ca_maxoperations))
735 return FALSE;
736
737 /* count4 ca_maxrequests */
738 if (!xdr_u_int32_t(xdr, &attrs->ca_maxrequests))
739 return FALSE;
740
741 if (xdr->x_op == XDR_ENCODE) {
742 /* uint32_t ca_rdma_ird<1> */
743 if (attrs->ca_rdma_ird)
744 {
745 if (!xdr_u_int32_t(xdr, &one))
746 return FALSE;
747 return xdr_u_int32_t(xdr, attrs->ca_rdma_ird);
748 }
749 else {
750 return xdr_u_int32_t(xdr, &zero);
751 }
752 }
753 else if (xdr->x_op == XDR_DECODE) {
754#if 0
756 /* uint32_t ca_rdma_ird<1> */
757 if (!xdr_u_int32_t(xdr, &count))
758 return FALSE;
759 if (count > 1)
760 return FALSE;
761 if (count)
762 return xdr_u_int32_t(xdr, attrs->ca_rdma_ird);
763 else
764#endif
765 return TRUE;
766 }
767 else {
768 eprintf("%s: xdr->x_op %d not supported.\n",
769 "xdr_channel_attrs4", xdr->x_op);
770 return FALSE;
771 }
772}
uint32_t ca_maxrequestsize
Definition: nfs41.h:232
uint32_t ca_headerpadsize
Definition: nfs41.h:231
uint32_t * ca_rdma_ird
Definition: nfs41.h:237
uint32_t ca_maxrequests
Definition: nfs41.h:236
uint32_t ca_maxresponsesize_cached
Definition: nfs41.h:234
uint32_t ca_maxresponsesize
Definition: nfs41.h:233
uint32_t ca_maxoperations
Definition: nfs41.h:235

Referenced by decode_op_create_session(), and encode_op_create_session().

◆ xdr_client_owner4()

static bool_t xdr_client_owner4 ( XDR xdr,
client_owner4 co 
)
static

Definition at line 460 of file nfs41_xdr.c.

463{
464 unsigned char *co_ownerid = co->co_ownerid;
465 if (!xdr_opaque(xdr, (char *)&co->co_verifier[0], NFS4_VERIFIER_SIZE))
466 return FALSE;
467
468 return xdr_bytes(xdr, (char **)&co_ownerid, &co->co_ownerid_le