ReactOS  0.4.12-dev-18-gf469aca
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,
2071  NFS_LIMIT_BLOCKS = 2
2072 };

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 {
190  bool_t result;
191  uint32_t len;
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 }
int32_t bool_t
Definition: types.h:101
#define NFS4_OPAQUE_LIMIT
Definition: nfs41_const.h:31
const char * name
Definition: nfs41_types.h:48
GLenum GLsizei len
Definition: glext.h:6722
UINT32 uint32_t
Definition: types.h:75
bool_t xdr_bytes(XDR *xdrs, char **cpp, u_int *sizep, u_int maxsize)
Definition: xdr.c:536
unsigned short len
Definition: nfs41_types.h:49
GLuint64EXT * result
Definition: glext.h:11304

◆ 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.

Referenced by decode_op_getattr(), and decode_readdir_entry().

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  }
1866  if (attrs->attrmask.arr[2] & FATTR4_WORD2_SUPPATTR_EXCLCREAT) {
1867  if (!xdr_bitmap4(xdr, info->suppattr_exclcreat))
1868  return FALSE;
1869  }
1870  }
1871  return TRUE;
1872 }
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
uint64_t space_avail
Definition: nfs41_types.h:224
static bool_t xdr_nfsace4(XDR *xdr, nfsace4 *ace)
Definition: nfs41_xdr.c:294
nfs41_fsid fsid
Definition: nfs41_types.h:209
uint32_t fs_layout_types
Definition: nfs41_types.h:234
#define TRUE
Definition: types.h:120
nfstime4 time_create
Definition: nfs41_types.h:212
bitmap4 * supported_attrs
Definition: nfs41_types.h:217
bool_t xdr_u_hyper(XDR *xdrs, u_longlong_t *ullp)
Definition: xdr.c:878
static bool_t xdr_layout_types(XDR *xdr, uint32_t *layout_type)
Definition: nfs41_xdr.c:222
fs_locations4 * fs_locations
Definition: nfs41_types.h:232
nfstime4 time_modify
Definition: nfs41_types.h:213
static bool_t xdr_fsid(XDR *xdr, nfs41_fsid *fsid)
Definition: nfs41_xdr.c:166
bool_t symlink_support
Definition: nfs41_types.h:242
static bool_t xdr_nfstime4(XDR *xdr, nfstime4 *nt)
Definition: nfs41_xdr.c:86
uint32_t arr[3]
Definition: nfs41_types.h:97
uint64_t space_free
Definition: nfs41_types.h:225
bitmap4 attrmask
Definition: nfs41_types.h:160
nfstime4 time_access
Definition: nfs41_types.h:211
bool_t(* xdrproc_t)(XDR *,...)
Definition: xdr.h:144
bool_t case_preserving
Definition: nfs41_types.h:240
uint32_t count
Definition: nfs41_types.h:96
static PVOID ptr
Definition: dispmode.c:27
mdsthreshold4 mdsthreshold
Definition: nfs41_types.h:210
#define NFS4_OPAQUE_LIMIT
Definition: nfs41_const.h:31
uint32_t rdattr_error
Definition: nfs41_types.h:229
static bool_t decode_fs_locations4(XDR *xdr, fs_locations4 *locations)
Definition: nfs41_xdr.c:419
bool_t xdr_bitmap4(XDR *xdr, bitmap4 *bitmap)
Definition: nfs41_xdr.c:48
nfsace4 * aces
Definition: nfs41_types.h:139
static bool_t xdr_nfsdacl41(XDR *xdr, nfsacl41 *acl)
Definition: nfs41_xdr.c:316
uint32_t aclsupport
Definition: nfs41_types.h:246
nfsacl41 * acl
Definition: nfs41_types.h:214
uint64_t space_total
Definition: nfs41_types.h:226
bitmap4 * suppattr_exclcreat
Definition: nfs41_types.h:218
uint32_t count
Definition: nfs41_types.h:140
static bool_t xdr_mdsthreshold(XDR *xdr, mdsthreshold4 *mdsthreshold)
Definition: nfs41_xdr.c:276
bool_t xdr_u_int32_t(XDR *xdrs, u_int32_t *u_int32_p)
Definition: xdr.c:239
bool_t xdr_bool(XDR *xdrs, bool_t *bp)
Definition: xdr.c:428
nfstime4 * time_delta
Definition: nfs41_types.h:215
UINT32 uint32_t
Definition: types.h:75
bool_t case_insensitive
Definition: nfs41_types.h:239
bool_t xdr_bytes(XDR *xdrs, char **cpp, u_int *sizep, u_int maxsize)
Definition: xdr.c:536
uint32_t lease_time
Definition: nfs41_types.h:233

◆ 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.

Referenced by decode_layout().

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 
3361 out_error:
3362  free(layout);
3363  return FALSE;
3364 }
static bool_t decode_file_layout_handles(XDR *xdr, pnfs_file_layout_handles *handles)
Definition: nfs41_xdr.c:3296
enum pnfs_layout_type type
Definition: pnfs.h:169
#define TRUE
Definition: types.h:120
bool_t xdr_u_hyper(XDR *xdrs, u_longlong_t *ullp)
Definition: xdr.c:878
enum pnfs_iomode iomode
Definition: pnfs.h:168
uint64_t offset
Definition: pnfs.h:166
#define free
Definition: debug_ros.c:5
pnfs_file_layout_handles filehandles
Definition: pnfs.h:179
#define PNFS_DEVICEID_SIZE
Definition: pnfs.h:111
uint32_t first_index
Definition: pnfs.h:183
unsigned char deviceid[PNFS_DEVICEID_SIZE]
Definition: pnfs.h:180
__WINE_SERVER_LIST_INLINE void list_add_tail(struct list *list, struct list *elem)
Definition: list.h:102
smooth NULL
Definition: ftsmooth.c:416
uint64_t pattern_offset
Definition: pnfs.h:182
uint64_t length
Definition: pnfs.h:167
uint32_t util
Definition: pnfs.h:184
struct list_entry entry
Definition: pnfs.h:165
bool_t xdr_opaque(XDR *xdrs, caddr_t cp, u_int cnt)
Definition: xdr.c:484
static DWORD layout
Definition: bitmap.c:46
unsigned int u_int32_t
Definition: rosdhcp.h:35
bool_t xdr_u_int32_t(XDR *xdrs, u_int32_t *u_int32_p)
Definition: xdr.c:239
pnfs_layout layout
Definition: pnfs.h:178
#define calloc
Definition: rosglue.h:14
__WINE_SERVER_LIST_INLINE void list_init(struct list *list)
Definition: list.h:149

◆ 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.

Referenced by decode_file_layout().

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
#define TRUE
Definition: types.h:120
GLuint GLuint GLsizei count
Definition: gl.h:1545
nfs41_path_fh * arr
Definition: pnfs.h:174
#define ZeroMemory
Definition: winbase.h:1635
GLenum GLclampf GLint i
Definition: glfuncs.h:14
smooth NULL
Definition: ftsmooth.c:416
static bool_t xdr_fh(XDR *xdr, nfs41_fh *fh)
Definition: nfs41_xdr.c:157
bool_t xdr_u_int32_t(XDR *xdrs, u_int32_t *u_int32_p)
Definition: xdr.c:239
UINT32 uint32_t
Definition: types.h:75

◆ decode_fs_location4()

static bool_t decode_fs_location4 ( XDR xdr,
fs_location4 location 
)
static

Definition at line 377 of file nfs41_xdr.c.

Referenced by decode_fs_locations4().

380 {
381  fs_location_server *arr;
382  char *address;
383  u_int32_t i, count, len;
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++) {
406  len = NFS41_HOSTNAME_LEN;
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 }
#define realloc
Definition: debug_ros.c:6
char address[NFS41_HOSTNAME_LEN+1]
Definition: nfs41_types.h:174
GLuint GLuint GLsizei count
Definition: gl.h:1545
#define free
Definition: debug_ros.c:5
#define ZeroMemory
Definition: winbase.h:1635
GLenum GLclampf GLint i
Definition: glfuncs.h:14
#define NFS41_HOSTNAME_LEN
Definition: nfs41_const.h:48
smooth NULL
Definition: ftsmooth.c:416
fs_location_server * servers
Definition: nfs41_types.h:179
GLuint address
Definition: glext.h:9393
uint32_t server_count
Definition: nfs41_types.h:180
GLenum GLsizei len
Definition: glext.h:6722
unsigned int u_int32_t
Definition: rosdhcp.h:35
bool_t xdr_u_int32_t(XDR *xdrs, u_int32_t *u_int32_p)
Definition: xdr.c:239
static bool_t decode_pathname4(XDR *xdr, nfs41_abs_path *path)
Definition: nfs41_xdr.c:343
nfs41_abs_path path
Definition: nfs41_types.h:178
bool_t xdr_bytes(XDR *xdrs, char **cpp, u_int *sizep, u_int maxsize)
Definition: xdr.c:536

◆ decode_fs_locations4()

static bool_t decode_fs_locations4 ( XDR xdr,
fs_locations4 locations 
)
static

Definition at line 419 of file nfs41_xdr.c.

Referenced by decode_file_attrs().

422 {
423  u_int32_t i, count;
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 }
#define realloc
Definition: debug_ros.c:6
#define TRUE
Definition: types.h:120
GLuint GLuint GLsizei count
Definition: gl.h:1545
#define free
Definition: debug_ros.c:5
#define ZeroMemory
Definition: winbase.h:1635
GLenum GLclampf GLint i
Definition: glfuncs.h:14
smooth NULL
Definition: ftsmooth.c:416
static bool_t decode_fs_location4(XDR *xdr, fs_location4 *location)
Definition: nfs41_xdr.c:377
nfs41_abs_path path
Definition: nfs41_types.h:184
unsigned int u_int32_t
Definition: rosdhcp.h:35
bool_t xdr_u_int32_t(XDR *xdrs, u_int32_t *u_int32_p)
Definition: xdr.c:239
fs_location4 * locations
Definition: nfs41_types.h:185
static bool_t decode_pathname4(XDR *xdr, nfs41_abs_path *path)
Definition: nfs41_xdr.c:343
uint32_t location_count
Definition: nfs41_types.h:186

◆ 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.

Referenced by decode_op_getdeviceinfo().

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 }
pnfs_device device
Definition: pnfs.h:140
bool_t xdr_enum(XDR *xdrs, enum_t *ep)
Definition: xdr.c:458
bool_t xdr_bitmap4(XDR *xdr, bitmap4 *bitmap)
Definition: nfs41_xdr.c:48
pnfs_file_device * device
Definition: nfs41_ops.h:983
int32_t enum_t
Definition: types.h:102
enum pnfs_layout_type type
Definition: pnfs.h:117
unsigned int u_int32_t
Definition: rosdhcp.h:35
bool_t xdr_u_int32_t(XDR *xdrs, u_int32_t *u_int32_p)
Definition: xdr.c:239
static bool_t xdr_file_device(XDR *xdr, pnfs_file_device *device)
Definition: nfs41_xdr.c:3120

◆ decode_layout()

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

Definition at line 3366 of file nfs41_xdr.c.

Referenced by decode_layout_res_ok().

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) {
3385  case PNFS_LAYOUTTYPE_FILE:
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 }
enum pnfs_layout_type type
Definition: pnfs.h:169
bool_t xdr_u_hyper(XDR *xdrs, u_longlong_t *ullp)
Definition: xdr.c:878
enum pnfs_iomode iomode
Definition: pnfs.h:168
uint64_t offset
Definition: pnfs.h:166
void eprintf(LPCSTR format,...)
Definition: daemon_debug.c:86
uint64_t length
Definition: pnfs.h:167
bool_t xdr_enum(XDR *xdrs, enum_t *ep)
Definition: xdr.c:458
int32_t enum_t
Definition: types.h:102
static DWORD layout
Definition: bitmap.c:46
static bool_t decode_file_layout(XDR *xdr, struct list_entry *list, pnfs_layout *base)
Definition: nfs41_xdr.c:3322

◆ 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.

Referenced by decode_op_layoutget().

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 }
struct list_entry layouts
Definition: nfs41_ops.h:920
#define TRUE
Definition: types.h:120
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
GLenum GLclampf GLint i
Definition: glfuncs.h:14
bool_t xdr_u_int32_t(XDR *xdrs, u_int32_t *u_int32_p)
Definition: xdr.c:239
bool_t xdr_bool(XDR *xdrs, bool_t *bp)
Definition: xdr.c:428
UINT32 uint32_t
Definition: types.h:75

◆ 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.

Referenced by decode_op_lock(), and decode_op_lockt().

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 }
bool_t xdr_u_hyper(XDR *xdrs, u_longlong_t *ullp)
Definition: xdr.c:878
uint64_t offset
Definition: nfs41_ops.h:436
state_owner4 owner
Definition: nfs41_ops.h:439
static bool_t xdr_state_owner4(XDR *xdr, state_owner4 *so)
Definition: nfs41_xdr.c:200
bool_t xdr_u_int32_t(XDR *xdrs, u_int32_t *u_int32_p)
Definition: xdr.c:239
uint32_t locktype
Definition: nfs41_ops.h:438
uint64_t length
Definition: nfs41_ops.h:437

◆ decode_modified_limit4()

static bool_t decode_modified_limit4 ( XDR xdr,
uint64_t filesize 
)
static

Definition at line 2053 of file nfs41_xdr.c.

Referenced by decode_space_limit4().

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 }
#define TRUE
Definition: types.h:120
static int blocks
Definition: mkdosfs.c:527
bool_t xdr_u_int32_t(XDR *xdrs, u_int32_t *u_int32_p)
Definition: xdr.c:239
UINT32 uint32_t
Definition: types.h:75

◆ 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 }
#define TRUE
Definition: types.h:120
if(!(yy_init))
Definition: macro.lex.yy.c:717
static __inline int unexpected_op(uint32_t op, uint32_t expected)
Definition: nfs41_xdr.c:36
bool_t xdr_u_int32_t(XDR *xdrs, u_int32_t *u_int32_p)
Definition: xdr.c:239
GLuint res
Definition: glext.h:9613
uint32_t supported
Definition: nfs41_ops.h:308

◆ 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 TRUE
Definition: types.h:120
#define NFS4_SESSIONID_SIZE
Definition: nfs41_const.h:32
int32_t bool_t
Definition: types.h:101
bool_t xdr_enum(XDR *xdrs, enum_t *ep)
Definition: xdr.c:458
if(!(yy_init))
Definition: macro.lex.yy.c:717
int32_t enum_t
Definition: types.h:102
static __inline int unexpected_op(uint32_t op, uint32_t expected)
Definition: nfs41_xdr.c:36
enum channel_dir_from_server4 dir
Definition: nfs41_ops.h:203
bool_t xdr_opaque(XDR *xdrs, caddr_t cp, u_int cnt)
Definition: xdr.c:484
bool_t xdr_bool(XDR *xdrs, bool_t *bp)
Definition: xdr.c:428
GLuint res
Definition: glext.h:9613

◆ 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 {
1253  stateid4 ignored;
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 }
#define TRUE
Definition: types.h:120
static bool_t xdr_stateid4(XDR *xdr, stateid4 *si)
Definition: nfs41_xdr.c:133
if(!(yy_init))
Definition: macro.lex.yy.c:717
static __inline int unexpected_op(uint32_t op, uint32_t expected)
Definition: nfs41_xdr.c:36
bool_t xdr_u_int32_t(XDR *xdrs, u_int32_t *u_int32_p)
Definition: xdr.c:239
uint8_t ignored[3]
Definition: fsck.fat.h:35
GLuint res
Definition: glext.h:9613

◆ 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 TRUE
Definition: types.h:120
#define NFS4_VERIFIER_SIZE
Definition: nfs41_const.h:30
unsigned char verf[NFS4_VERIFIER_SIZE]
Definition: nfs41_types.h:76
if(!(yy_init))
Definition: macro.lex.yy.c:717
static __inline int unexpected_op(uint32_t op, uint32_t expected)
Definition: nfs41_xdr.c:36
bool_t xdr_opaque(XDR *xdrs, caddr_t cp, u_int cnt)
Definition: xdr.c:484
nfs41_write_verf * verf
Definition: nfs41_ops.h:332
bool_t xdr_u_int32_t(XDR *xdrs, u_int32_t *u_int32_p)
Definition: xdr.c:239
GLuint res
Definition: glext.h:9613

◆ 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 }
static bool_t xdr_change_info4(XDR *xdr, change_info4 *cinfo)
Definition: nfs41_xdr.c:1371
#define TRUE
Definition: types.h:120
change_info4 cinfo
Definition: nfs41_ops.h:364
bool_t xdr_bitmap4(XDR *xdr, bitmap4 *bitmap)
Definition: nfs41_xdr.c:48
if(!(yy_init))
Definition: macro.lex.yy.c:717
static __inline int unexpected_op(uint32_t op, uint32_t expected)
Definition: nfs41_xdr.c:36
bool_t xdr_u_int32_t(XDR *xdrs, u_int32_t *u_int32_p)
Definition: xdr.c:239
GLuint res
Definition: glext.h:9613

◆ 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 }
#define TRUE
Definition: types.h:120
#define NFS4_SESSIONID_SIZE
Definition: nfs41_const.h:32
nfs41_channel_attrs * csr_fore_chan_attrs
Definition: nfs41_ops.h:176
if(!(yy_init))
Definition: macro.lex.yy.c:717
unsigned char * csr_sessionid
Definition: nfs41_ops.h:173
static __inline int unexpected_op(uint32_t op, uint32_t expected)
Definition: nfs41_xdr.c:36
nfs41_channel_attrs * csr_back_chan_attrs
Definition: nfs41_ops.h:177
bool_t xdr_opaque(XDR *xdrs, caddr_t cp, u_int cnt)
Definition: xdr.c:484
static bool_t xdr_channel_attrs4(XDR *xdr, nfs41_channel_attrs *attrs)
Definition: nfs41_xdr.c:710
bool_t xdr_u_int32_t(XDR *xdrs, u_int32_t *u_int32_p)
Definition: xdr.c:239
UINT32 uint32_t
Definition: types.h:75
GLuint res
Definition: glext.h:9613

◆ 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 }
if(!(yy_init))
Definition: macro.lex.yy.c:717
static __inline int unexpected_op(uint32_t op, uint32_t expected)
Definition: nfs41_xdr.c:36
bool_t xdr_u_int32_t(XDR *xdrs, u_int32_t *u_int32_p)
Definition: xdr.c:239
GLuint res
Definition: glext.h:9613

◆ 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 
1684  if (unexpected_op(resop->op, OP_DELEGRETURN))
1685  return FALSE;
1686 
1687  return xdr_u_int32_t(xdr, &res->status);
1688 }
if(!(yy_init))
Definition: macro.lex.yy.c:717
static __inline int unexpected_op(uint32_t op, uint32_t expected)
Definition: nfs41_xdr.c:36
bool_t xdr_u_int32_t(XDR *xdrs, u_int32_t *u_int32_p)
Definition: xdr.c:239
GLuint res
Definition: glext.h:9613

◆ 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 }
if(!(yy_init))
Definition: macro.lex.yy.c:717
static __inline int unexpected_op(uint32_t op, uint32_t expected)
Definition: nfs41_xdr.c:36
bool_t xdr_u_int32_t(XDR *xdrs, u_int32_t *u_int32_p)
Definition: xdr.c:239
GLuint res
Definition: glext.h:9613

◆ 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 }
if(!(yy_init))
Definition: macro.lex.yy.c:717
static __inline int unexpected_op(uint32_t op, uint32_t expected)
Definition: nfs41_xdr.c:36
bool_t xdr_u_int32_t(XDR *xdrs, u_int32_t *u_int32_p)
Definition: xdr.c:239
GLuint res
Definition: glext.h:9613

◆ 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,
705 }
static bool_t xdr_state_protect4_r(XDR *xdr, state_protect4_r *spr)
Definition: nfs41_xdr.c:629
#define TRUE
Definition: types.h:120
bool_t xdr_u_hyper(XDR *xdrs, u_longlong_t *ullp)
Definition: xdr.c:878
#define NFS4_OPAQUE_LIMIT
Definition: nfs41_const.h:31
server_owner4 server_owner
Definition: nfs41_ops.h:137
static bool_t xdr_server_owner4(XDR *xdr, server_owner4 *so)
Definition: nfs41_xdr.c:659
static __inline int unexpected_op(uint32_t op, uint32_t expected)
Definition: nfs41_xdr.c:36
state_protect4_r state_protect
Definition: nfs41_ops.h:136
bool_t xdr_u_int32_t(XDR *xdrs, u_int32_t *u_int32_p)
Definition: xdr.c:239
char server_scope[NFS4_OPAQUE_LIMIT]
Definition: nfs41_ops.h:139
GLuint res
Definition: glext.h:9613
bool_t xdr_bytes(XDR *xdrs, char **cpp, u_int *sizep, u_int maxsize)
Definition: xdr.c:536

◆ 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 
2784  if (unexpected_op(resop->op, OP_FREE_STATEID))
2785  return FALSE;
2786 
2787  return xdr_u_int32_t(xdr, &res->status);
2788 }
if(!(yy_init))
Definition: macro.lex.yy.c:717
static __inline int unexpected_op(uint32_t op, uint32_t expected)
Definition: nfs41_xdr.c:36
bool_t xdr_u_int32_t(XDR *xdrs, u_int32_t *u_int32_p)
Definition: xdr.c:239
GLuint res
Definition: glext.h:9613

◆ 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;
1893  return decode_file_attrs(&attr_xdr, &res->obj_attributes, res->info);
1894  }
1895  return TRUE;
1896 }
static bool_t decode_file_attrs(XDR *xdr, fattr4 *attrs, nfs41_file_info *info)
Definition: nfs41_xdr.c:1706
#define TRUE
Definition: types.h:120
unsigned char attr_vals[NFS4_OPAQUE_LIMIT]
Definition: nfs41_types.h:162
Definition: xdr.h:103
if(!(yy_init))
Definition: macro.lex.yy.c:717
nfs41_file_info * info
Definition: nfs41_ops.h:534
uint32_t attr_vals_len
Definition: nfs41_types.h:161
static __inline int unexpected_op(uint32_t op, uint32_t expected)
Definition: nfs41_xdr.c:36
bool_t xdr_fattr4(XDR *xdr, fattr4 *fattr)
Definition: nfs41_xdr.c:144
bool_t xdr_u_int32_t(XDR *xdrs, u_int32_t *u_int32_p)
Definition: xdr.c:239
void xdrmem_create(XDR *xdrs, char *addr, u_int size, enum xdr_op op)
Definition: xdr_mem.c:94
GLuint res
Definition: glext.h:9613
Definition: xdr.h:86

◆ 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 
3157  if (unexpected_op(resop->op, OP_GETDEVICEINFO))
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  {
3169  uint32_t ignored;
3170  return xdr_u_int32_t(xdr, &ignored);
3171  }
3172  break;
3173  }
3174  return TRUE;
3175 }
pnfs_getdeviceinfo_res_ok res_ok
Definition: nfs41_ops.h:991
#define TRUE
Definition: types.h:120
union __pnfs_getdeviceinfo_res::@43 u
if(!(yy_init))
Definition: macro.lex.yy.c:717
static bool_t decode_getdeviceinfo_ok(XDR *xdr, pnfs_getdeviceinfo_res_ok *res_ok)
Definition: nfs41_xdr.c:3130
static __inline int unexpected_op(uint32_t op, uint32_t expected)
Definition: nfs41_xdr.c:36
bool_t xdr_u_int32_t(XDR *xdrs, u_int32_t *u_int32_p)
Definition: xdr.c:239
enum nfsstat4 status
Definition: nfs41_ops.h:988
UINT32 uint32_t
Definition: types.h:75
uint8_t ignored[3]
Definition: fsck.fat.h:35
GLuint res
Definition: glext.h:9613

◆ 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 {
1149  nfs41_getfh_res *res = (nfs41_getfh_res*)resop->res;
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 }
nfs41_fh * fh
Definition: nfs41_ops.h:504
#define TRUE
Definition: types.h:120
uint32_t status
Definition: nfs41_ops.h:502
if(!(yy_init))
Definition: macro.lex.yy.c:717
static __inline int unexpected_op(uint32_t op, uint32_t expected)
Definition: nfs41_xdr.c:36
static bool_t xdr_fh(XDR *xdr, nfs41_fh *fh)
Definition: nfs41_xdr.c:157
bool_t xdr_u_int32_t(XDR *xdrs, u_int32_t *u_int32_p)
Definition: xdr.c:239
GLuint res
Definition: glext.h:9613

◆ 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 
3243  if (unexpected_op(resop->op, OP_LAYOUTCOMMIT))
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 }
#define TRUE
Definition: types.h:120
bool_t xdr_u_hyper(XDR *xdrs, u_longlong_t *ullp)
Definition: xdr.c:878
if(!(yy_init))
Definition: macro.lex.yy.c:717
static __inline int unexpected_op(uint32_t op, uint32_t expected)
Definition: nfs41_xdr.c:36
bool_t xdr_u_int32_t(XDR *xdrs, u_int32_t *u_int32_p)
Definition: xdr.c:239
bool_t xdr_bool(XDR *xdrs, bool_t *bp)
Definition: xdr.c:428
GLuint res
Definition: glext.h:9613

◆ 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 }
static bool_t decode_layout_res_ok(XDR *xdr, pnfs_layoutget_res_ok *res)
Definition: nfs41_xdr.c:3395
#define TRUE
Definition: types.h:120
union __pnfs_layoutget_res::@42 u
if(!(yy_init))
Definition: macro.lex.yy.c:717
static __inline int unexpected_op(uint32_t op, uint32_t expected)
Definition: nfs41_xdr.c:36
pnfs_layoutget_res_ok * res_ok
Definition: nfs41_ops.h:927
enum nfsstat4 status
Definition: nfs41_ops.h:924
bool_t xdr_u_int32_t(XDR *xdrs, u_int32_t *u_int32_p)
Definition: xdr.c:239
bool_t xdr_bool(XDR *xdrs, bool_t *bp)
Definition: xdr.c:428
UINT32 uint32_t
Definition: types.h:75
bool_t will_signal_layout_avail
Definition: nfs41_ops.h:929
GLuint res
Definition: glext.h:9613

◆ 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 
3488  if (unexpected_op(resop->op, OP_LAYOUTRETURN))
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 }
#define TRUE
Definition: types.h:120
enum nfsstat4 status
Definition: nfs41_ops.h:966
static bool_t xdr_stateid4(XDR *xdr, stateid4 *si)
Definition: nfs41_xdr.c:133
if(!(yy_init))
Definition: macro.lex.yy.c:717
static __inline int unexpected_op(uint32_t op, uint32_t expected)
Definition: nfs41_xdr.c:36
bool_t xdr_u_int32_t(XDR *xdrs, u_int32_t *u_int32_p)
Definition: xdr.c:239
bool_t xdr_bool(XDR *xdrs, bool_t *bp)
Definition: xdr.c:428
UINT32 uint32_t
Definition: types.h:75
GLuint res
Definition: glext.h:9613

◆ 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 {
1425  nfs41_link_res *res = (nfs41_link_res*)resop->res;
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 }
static bool_t xdr_change_info4(XDR *xdr, change_info4 *cinfo)
Definition: nfs41_xdr.c:1371
#define TRUE
Definition: types.h:120
if(!(yy_init))
Definition: macro.lex.yy.c:717
static __inline int unexpected_op(uint32_t op, uint32_t expected)
Definition: nfs41_xdr.c:36
bool_t xdr_u_int32_t(XDR *xdrs, u_int32_t *u_int32_p)
Definition: xdr.c:239
GLuint res
Definition: glext.h:9613

◆ 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 {
1521  nfs41_lock_res *res = (nfs41_lock_res*)resop->res;
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 }
#define TRUE
Definition: types.h:120
lock_res_ok resok4
Definition: nfs41_ops.h:450
static bool_t decode_lock_res_denied(XDR *xdr, lock_res_denied *denied)
Definition: nfs41_xdr.c:1501
static bool_t xdr_stateid4(XDR *xdr, stateid4 *si)
Definition: nfs41_xdr.c:133
uint32_t status
Definition: nfs41_ops.h:447
stateid4 * lock_stateid
Definition: nfs41_ops.h:443
if(!(yy_init))
Definition: macro.lex.yy.c:717
union __nfs41_lock_res::@39 u
static __inline int unexpected_op(uint32_t op, uint32_t expected)
Definition: nfs41_xdr.c:36
bool_t xdr_u_int32_t(XDR *xdrs, u_int32_t *u_int32_p)
Definition: xdr.c:239
lock_res_denied denied
Definition: nfs41_ops.h:452
GLuint res
Definition: glext.h:9613

◆ 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 {
1572  nfs41_lockt_res *res = (nfs41_lockt_res*)resop->res;
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 }
#define TRUE
Definition: types.h:120
static bool_t decode_lock_res_denied(XDR *xdr, lock_res_denied *denied)
Definition: nfs41_xdr.c:1501
uint32_t status
Definition: nfs41_ops.h:467
if(!(yy_init))
Definition: macro.lex.yy.c:717
static __inline int unexpected_op(uint32_t op, uint32_t expected)
Definition: nfs41_xdr.c:36
bool_t xdr_u_int32_t(XDR *xdrs, u_int32_t *u_int32_p)
Definition: xdr.c:239
lock_res_denied denied
Definition: nfs41_ops.h:469
GLuint res
Definition: glext.h:9613

◆ 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 {
1618  nfs41_locku_res *res = (nfs41_locku_res*)resop->res;
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 }
#define TRUE
Definition: types.h:120
uint32_t status
Definition: nfs41_ops.h:484
stateid4 * lock_stateid
Definition: nfs41_ops.h:486
static bool_t xdr_stateid4(XDR *xdr, stateid4 *si)
Definition: nfs41_xdr.c:133
if(!(yy_init))
Definition: macro.lex.yy.c:717
static __inline int unexpected_op(uint32_t op, uint32_t expected)
Definition: nfs41_xdr.c:36
bool_t xdr_u_int32_t(XDR *xdrs, u_int32_t *u_int32_p)
Definition: xdr.c:239
GLuint res
Definition: glext.h:9613

◆ 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 }
if(!(yy_init))
Definition: macro.lex.yy.c:717
static __inline int unexpected_op(uint32_t op, uint32_t expected)
Definition: nfs41_xdr.c:36
bool_t xdr_u_int32_t(XDR *xdrs, u_int32_t *u_int32_p)
Definition: xdr.c:239
GLuint res
Definition: glext.h:9613

◆ 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 }
#define TRUE
Definition: types.h:120
nfs41_op_open_res_ok resok4
Definition: nfs41_ops.h:668
if(!(yy_init))
Definition: macro.lex.yy.c:717
static bool_t decode_open_res_ok(XDR *xdr, nfs41_op_open_res_ok *res)
Definition: nfs41_xdr.c:2113
static __inline int unexpected_op(uint32_t op, uint32_t expected)
Definition: nfs41_xdr.c:36
bool_t xdr_u_int32_t(XDR *xdrs, u_int32_t *u_int32_p)
Definition: xdr.c:239
GLuint res
Definition: glext.h:9613

◆ 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 }
if(!(yy_init))
Definition: macro.lex.yy.c:717
static __inline int unexpected_op(uint32_t op, uint32_t expected)
Definition: nfs41_xdr.c:36
bool_t xdr_u_int32_t(XDR *xdrs, u_int32_t *u_int32_p)
Definition: xdr.c:239
GLuint res
Definition: glext.h:9613

◆ 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 {
1096  nfs41_putfh_res *res = (nfs41_putfh_res*)resop->res;
1097 
1098  if (unexpected_op(resop->op, OP_PUTFH))
1099  return FALSE;
1100 
1101  return xdr_u_int32_t(xdr, &res->status);
1102 }
if(!(yy_init))
Definition: macro.lex.yy.c:717
uint32_t status
Definition: nfs41_ops.h:515
static __inline int unexpected_op(uint32_t op, uint32_t expected)
Definition: nfs41_xdr.c:36
bool_t xdr_u_int32_t(XDR *xdrs, u_int32_t *u_int32_p)
Definition: xdr.c:239
GLuint res
Definition: glext.h:9613

◆ 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 }
if(!(yy_init))
Definition: macro.lex.yy.c:717
static __inline int unexpected_op(uint32_t op, uint32_t expected)
Definition: nfs41_xdr.c:36
bool_t xdr_u_int32_t(XDR *xdrs, u_int32_t *u_int32_p)
Definition: xdr.c:239
GLuint res
Definition: glext.h:9613

◆ 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 {
2233  nfs41_read_res *res = (nfs41_read_res*)resop->res;
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 }
#define TRUE
Definition: types.h:120
static bool_t decode_read_res_ok(XDR *xdr, nfs41_read_res_ok *res)
Definition: nfs41_xdr.c:2217
nfs41_read_res_ok resok4
Definition: nfs41_ops.h:698
if(!(yy_init))
Definition: macro.lex.yy.c:717
static __inline int unexpected_op(uint32_t op, uint32_t expected)
Definition: nfs41_xdr.c:36
bool_t xdr_u_int32_t(XDR *xdrs, u_int32_t *u_int32_p)
Definition: xdr.c:239
GLuint res
Definition: glext.h:9613
uint32_t status
Definition: nfs41_ops.h:696

◆ 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 }
#define TRUE
Definition: types.h:120
#define NFS4_VERIFIER_SIZE
Definition: nfs41_const.h:30
unsigned char cookieverf[NFS4_VERIFIER_SIZE]
Definition: nfs41_ops.h:728
if(!(yy_init))
Definition: macro.lex.yy.c:717
nfs41_readdir_list reply
Definition: nfs41_ops.h:729
static __inline int unexpected_op(uint32_t op, uint32_t expected)
Definition: nfs41_xdr.c:36
bool_t xdr_opaque(XDR *xdrs, caddr_t cp, u_int cnt)
Definition: xdr.c:484
static bool_t decode_readdir_list(XDR *xdr, nfs41_readdir_list *dirs)
Definition: nfs41_xdr.c:2346
bool_t xdr_u_int32_t(XDR *xdrs, u_int32_t *u_int32_p)
Definition: xdr.c:239
GLuint res
Definition: glext.h:9613

◆ 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 }
#define TRUE
Definition: types.h:120
if(!(yy_init))
Definition: macro.lex.yy.c:717
static __inline int unexpected_op(uint32_t op, uint32_t expected)
Definition: nfs41_xdr.c:36
bool_t xdr_u_int32_t(XDR *xdrs, u_int32_t *u_int32_p)
Definition: xdr.c:239
GLuint res
Definition: glext.h:9613
bool_t xdr_bytes(XDR *xdrs, char **cpp, u_int *sizep, u_int maxsize)
Definition: xdr.c:536
const WCHAR * link
Definition: db.cpp:926

◆ 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 }
bool_t xdr_enum(XDR *xdrs, enum_t *ep)
Definition: xdr.c:458
if(!(yy_init))
Definition: macro.lex.yy.c:717
int32_t enum_t
Definition: types.h:102
static __inline int unexpected_op(uint32_t op, uint32_t expected)
Definition: nfs41_xdr.c:36
GLuint res
Definition: glext.h:9613

◆ 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 }
static bool_t xdr_change_info4(XDR *xdr, change_info4 *cinfo)
Definition: nfs41_xdr.c:1371
#define TRUE
Definition: types.h:120
change_info4 cinfo
Definition: nfs41_ops.h:750
if(!(yy_init))
Definition: macro.lex.yy.c:717
static __inline int unexpected_op(uint32_t op, uint32_t expected)
Definition: nfs41_xdr.c:36
bool_t xdr_u_int32_t(XDR *xdrs, u_int32_t *u_int32_p)
Definition: xdr.c:239
GLuint res
Definition: glext.h:9613

◆ 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 }
static bool_t xdr_change_info4(XDR *xdr, change_info4 *cinfo)
Definition: nfs41_xdr.c:1371
#define TRUE
Definition: types.h:120
change_info4 target_cinfo
Definition: nfs41_ops.h:764
change_info4 source_cinfo
Definition: nfs41_ops.h:763
if(!(yy_init))
Definition: macro.lex.yy.c:717
static __inline int unexpected_op(uint32_t op, uint32_t expected)
Definition: nfs41_xdr.c:36
bool_t xdr_u_int32_t(XDR *xdrs, u_int32_t *u_int32_p)
Definition: xdr.c:239
GLuint res
Definition: glext.h:9613

◆ 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 }
if(!(yy_init))
Definition: macro.lex.yy.c:717
static __inline int unexpected_op(uint32_t op, uint32_t expected)
Definition: nfs41_xdr.c:36
bool_t xdr_u_int32_t(XDR *xdrs, u_int32_t *u_int32_p)
Definition: xdr.c:239
GLuint res
Definition: glext.h:9613

◆ 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 }
if(!(yy_init))
Definition: macro.lex.yy.c:717
static __inline int unexpected_op(uint32_t op, uint32_t expected)
Definition: nfs41_xdr.c:36
bool_t xdr_u_int32_t(XDR *xdrs, u_int32_t *u_int32_p)
Definition: xdr.c:239
GLuint res
Definition: glext.h:9613

◆ 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 }
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
#define TRUE
Definition: types.h:120
nfs41_secinfo_info * secinfo
Definition: nfs41_ops.h:900
bool_t(* xdrproc_t)(XDR *,...)
Definition: xdr.h:144
static bool_t xdr_secinfo(XDR *xdr, nfs41_secinfo_info *secinfo)
Definition: nfs41_xdr.c:2893
if(!(yy_init))
Definition: macro.lex.yy.c:717
#define MAX_SECINFOS
Definition: nfs41_ops.h:881
static __inline int unexpected_op(uint32_t op, uint32_t expected)
Definition: nfs41_xdr.c:36
bool_t xdr_u_int32_t(XDR *xdrs, u_int32_t *u_int32_p)
Definition: xdr.c:239
GLuint res
Definition: glext.h:9613

◆ 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 }
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
#define TRUE
Definition: types.h:120
nfs41_secinfo_info * secinfo
Definition: nfs41_ops.h:900
bool_t(* xdrproc_t)(XDR *,...)
Definition: xdr.h:144
static bool_t xdr_secinfo(XDR *xdr, nfs41_secinfo_info *secinfo)
Definition: nfs41_xdr.c:2893
if(!(yy_init))
Definition: macro.lex.yy.c:717
#define MAX_SECINFOS
Definition: nfs41_ops.h:881
static __inline int unexpected_op(uint32_t op, uint32_t expected)
Definition: nfs41_xdr.c:36
bool_t xdr_u_int32_t(XDR *xdrs, u_int32_t *u_int32_p)
Definition: xdr.c:239
GLuint res
Definition: glext.h:9613

◆ 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 }
#define TRUE
Definition: types.h:120
nfs41_sequence_res_ok sr_resok4
Definition: nfs41_ops.h:264
static bool_t xdr_sequence_res_ok(XDR *xdr, nfs41_sequence_res_ok *res)
Definition: nfs41_xdr.c:1007
if(!(yy_init))
Definition: macro.lex.yy.c:717
static __inline int unexpected_op(uint32_t op, uint32_t expected)
Definition: nfs41_xdr.c:36
bool_t xdr_u_int32_t(XDR *xdrs, u_int32_t *u_int32_p)
Definition: xdr.c:239
GLuint res
Definition: glext.h:9613

◆ 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 }
#define TRUE
Definition: types.h:120
bool_t xdr_bitmap4(XDR *xdr, bitmap4 *bitmap)
Definition: nfs41_xdr.c:48
if(!(yy_init))
Definition: macro.lex.yy.c:717
static __inline int unexpected_op(uint32_t op, uint32_t expected)
Definition: nfs41_xdr.c:36
bool_t xdr_u_int32_t(XDR *xdrs, u_int32_t *u_int32_p)
Definition: xdr.c:239
GLuint res
Definition: glext.h:9613

◆ 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 
2813  if (unexpected_op(resop->op, OP_TEST_STATEID))
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 }
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
#define TRUE
Definition: types.h:120
struct __nfs41_test_stateid_res::@41 resok
bool_t(* xdrproc_t)(XDR *,...)
Definition: xdr.h:144
if(!(yy_init))
Definition: macro.lex.yy.c:717
static __inline int unexpected_op(uint32_t op, uint32_t expected)
Definition: nfs41_xdr.c:36
bool_t xdr_u_int32_t(XDR *xdrs, u_int32_t *u_int32_p)
Definition: xdr.c:239
UINT32 uint32_t
Definition: types.h:75
GLuint res
Definition: glext.h:9613

◆ 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);
2753  case OPEN_DELEGATE_WRITE:
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 }
#define TRUE
Definition: types.h:120
static bool_t decode_open_none_delegation4(XDR *xdr, open_delegation4 *delegation)
Definition: nfs41_xdr.c:2020
void eprintf(LPCSTR format,...)
Definition: daemon_debug.c:86
open_delegation4 * delegation
Definition: nfs41_ops.h:807
bool_t xdr_enum(XDR *xdrs, enum_t *ep)
Definition: xdr.c:458
static bool_t decode_open_read_delegation4(XDR *xdr, open_delegation4 *delegation)
Definition: nfs41_xdr.c:2040
if(!(yy_init))
Definition: macro.lex.yy.c:717
enum open_delegation_type4 type
Definition: nfs41_types.h:154
int32_t enum_t
Definition: types.h:102
static __inline int unexpected_op(uint32_t op, uint32_t expected)
Definition: nfs41_xdr.c:36
bool_t xdr_u_int32_t(XDR *xdrs, u_int32_t *u_int32_p)
Definition: xdr.c:239
static bool_t decode_open_write_delegation4(XDR *xdr, open_delegation4 *delegation)
Definition: nfs41_xdr.c:2095
GLuint res
Definition: glext.h:9613

◆ 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 {
2876  nfs41_write_res *res = (nfs41_write_res*)resop->res;
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 }
#define TRUE
Definition: types.h:120
nfs41_write_res_ok resok4
Definition: nfs41_ops.h:857
if(!(yy_init))
Definition: macro.lex.yy.c:717
static __inline int unexpected_op(uint32_t op, uint32_t expected)
Definition: nfs41_xdr.c:36
bool_t xdr_u_int32_t(XDR *xdrs, u_int32_t *u_int32_p)
Definition: xdr.c:239
uint32_t status
Definition: nfs41_ops.h:855
GLuint res
Definition: glext.h:9613
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.

Referenced by decode_op_want_delegation(), and decode_open_res_ok().

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 }
#define TRUE
Definition: types.h:120
int32_t bool_t
Definition: types.h:101
bool_t xdr_enum(XDR *xdrs, enum_t *ep)
Definition: xdr.c:458
int32_t enum_t
Definition: types.h:102
bool_t xdr_bool(XDR *xdrs, bool_t *bp)
Definition: xdr.c:428

◆ 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.

Referenced by decode_op_want_delegation(), and decode_open_res_ok().

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 }
static bool_t xdr_nfsace4(XDR *xdr, nfsace4 *ace)
Definition: nfs41_xdr.c:294
static bool_t xdr_stateid4(XDR *xdr, stateid4 *si)
Definition: nfs41_xdr.c:133
bool_t xdr_bool(XDR *xdrs, bool_t *bp)
Definition: xdr.c:428

◆ 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.

Referenced by decode_op_open().

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);
2140  case OPEN_DELEGATE_WRITE:
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 }
static bool_t xdr_change_info4(XDR *xdr, change_info4 *cinfo)
Definition: nfs41_xdr.c:1371
open_delegation4 * delegation
Definition: nfs41_ops.h:662
#define TRUE
Definition: types.h:120
static bool_t decode_open_none_delegation4(XDR *xdr, open_delegation4 *delegation)
Definition: nfs41_xdr.c:2020
void eprintf(LPCSTR format,...)
Definition: daemon_debug.c:86
static bool_t xdr_stateid4(XDR *xdr, stateid4 *si)
Definition: nfs41_xdr.c:133
change_info4 cinfo
Definition: nfs41_ops.h:659
bool_t xdr_enum(XDR *xdrs, enum_t *ep)
Definition: xdr.c:458
bool_t xdr_bitmap4(XDR *xdr, bitmap4 *bitmap)
Definition: nfs41_xdr.c:48
static bool_t decode_open_read_delegation4(XDR *xdr, open_delegation4 *delegation)
Definition: nfs41_xdr.c:2040
enum open_delegation_type4 type
Definition: nfs41_types.h:154
int32_t enum_t
Definition: types.h:102
bool_t xdr_u_int32_t(XDR *xdrs, u_int32_t *u_int32_p)
Definition: xdr.c:239
static bool_t decode_open_write_delegation4(XDR *xdr, open_delegation4 *delegation)
Definition: nfs41_xdr.c:2095

◆ 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.

Referenced by decode_op_want_delegation(), and decode_open_res_ok().

2098 {
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 }
static bool_t xdr_nfsace4(XDR *xdr, nfsace4 *ace)
Definition: nfs41_xdr.c:294
static bool_t xdr_stateid4(XDR *xdr, stateid4 *si)
Definition: nfs41_xdr.c:133
static bool_t decode_space_limit4(XDR *xdr, uint64_t *filesize)
Definition: nfs41_xdr.c:2074
UINT64 uint64_t
Definition: types.h:77
bool_t xdr_bool(XDR *xdrs, bool_t *bp)
Definition: xdr.c:428
DWORD size_limit
Definition: cdmake.c:198

◆ decode_pathname4()

static bool_t decode_pathname4 ( XDR xdr,
nfs41_abs_path path 
)
static

Definition at line 343 of file nfs41_xdr.c.

Referenced by decode_fs_location4(), and decode_fs_locations4().

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 }
#define TRUE
Definition: types.h:120
GLuint GLuint GLsizei count
Definition: gl.h:1545
#define NFS41_MAX_PATH_LEN
Definition: nfs41_const.h:46
unsigned short(__cdecl typeof(TIFFCurrentDirectory))(struct tiff *)
Definition: typeof.h:91
GLenum GLclampf GLint i
Definition: glfuncs.h:14
unsigned short len
Definition: nfs41_types.h:43
#define for
Definition: utility.h:88
GLenum GLsizei len
Definition: glext.h:6722
unsigned int u_int32_t
Definition: rosdhcp.h:35
bool_t xdr_u_int32_t(XDR *xdrs, u_int32_t *u_int32_p)
Definition: xdr.c:239
bool_t xdr_bytes(XDR *xdrs, char **cpp, u_int *sizep, u_int maxsize)
Definition: xdr.c:536
char path[NFS41_MAX_PATH_LEN]
Definition: nfs41_types.h:42

◆ 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.

Referenced by decode_op_read().

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 }
unsigned char * data
Definition: nfs41_ops.h:692
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
bool_t xdr_bool(XDR *xdrs, bool_t *bp)
Definition: xdr.c:428
#define NFS41_MAX_FILEIO_SIZE
Definition: nfs41_const.h:38
bool_t xdr_bytes(XDR *xdrs, char **cpp, u_int *sizep, u_int maxsize)
Definition: xdr.c:536

◆ 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.

Referenced by decode_readdir_list().

2286 {
2287  uint64_t cookie;
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;
2297  entry_len = (uint32_t)FIELD_OFFSET(nfs41_readdir_entry, name);
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)))
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 }
static bool_t decode_file_attrs(XDR *xdr, fattr4 *attrs, nfs41_file_info *info)
Definition: nfs41_xdr.c:1706
#define TRUE
Definition: types.h:120
bool_t xdr_u_hyper(XDR *xdrs, u_longlong_t *ullp)
Definition: xdr.c:878
Definition: nfs41_ops.h:710
unsigned char attr_vals[NFS4_OPAQUE_LIMIT]
Definition: nfs41_types.h:162
uint8_t entry
Definition: isohybrid.c:63
#define ZeroMemory
Definition: winbase.h:1635
uint64_t cookie
Definition: nfs41_ops.h:711
const char * STRSAFE_LPCSTR
Definition: ntstrsafe.h:62
Definition: xdr.h:103
uint32_t * last_entry_offset
Definition: nfs41_xdr.c:2278
#define NFS4_OPAQUE_LIMIT
Definition: nfs41_const.h:31
uint32_t rdattr_error
Definition: nfs41_types.h:229
bool_t ignore_the_rest
Definition: nfs41_xdr.c:2279
char name[1]
Definition: nfs41_ops.h:715
unsigned char * buf_pos
Definition: nfs41_xdr.c:2276
uint32_t next_entry_offset
Definition: nfs41_ops.h:713
uint32_t remaining_len
Definition: nfs41_xdr.c:2277
if(!(yy_init))
Definition: macro.lex.yy.c:717
nfs41_file_info attr_info
Definition: nfs41_ops.h:714
uint32_t attr_vals_len
Definition: nfs41_types.h:161
bool_t xdr_fattr4(XDR *xdr, fattr4 *fattr)
Definition: nfs41_xdr.c:144
uint32_t name_len
Definition: nfs41_ops.h:712
STRSAFEAPI StringCchCopyA(STRSAFE_LPSTR pszDest, size_t cchDest, STRSAFE_LPCSTR pszSrc)
Definition: strsafe.h:145
UINT64 uint64_t
Definition: types.h:77
bool_t xdr_bool(XDR *xdrs, bool_t *bp)
Definition: xdr.c:428
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:254
void xdrmem_create(XDR *xdrs, char *addr, u_int size, enum xdr_op op)
Definition: xdr_mem.c:94
UINT32 uint32_t
Definition: types.h:75
bool_t has_next_entry
Definition: nfs41_xdr.c:2280
Definition: name.c:36
Definition: xdr.h:86
bool_t xdr_bytes(XDR *xdrs, char **cpp, u_int *sizep, u_int maxsize)
Definition: xdr.c:536
#define uint32_t
Definition: nsiface.idl:61

◆ 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.

Referenced by decode_op_readdir().

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 }
unsigned char * entries
Definition: nfs41_ops.h:721
#define TRUE
Definition: types.h:120
uint32_t * last_entry_offset
Definition: nfs41_xdr.c:2278
smooth NULL
Definition: ftsmooth.c:416
bool_t ignore_the_rest
Definition: nfs41_xdr.c:2279
Definition: nfs41_xdr.c:2275
unsigned char * buf_pos
Definition: nfs41_xdr.c:2276
static bool_t decode_readdir_entry(XDR *xdr, readdir_entry_iterator *it)
Definition: nfs41_xdr.c:2283
uint32_t remaining_len
Definition: nfs41_xdr.c:2277
uint32_t entries_len
Definition: nfs41_ops.h:720
bool_t xdr_bool(XDR *xdrs, bool_t *bp)
Definition: xdr.c:428
bool_t has_next_entry
Definition: nfs41_xdr.c:2280

◆ decode_space_limit4()

static bool_t decode_space_limit4 ( XDR xdr,
uint64_t filesize 
)
static

Definition at line 2074 of file nfs41_xdr.c.

Referenced by decode_open_write_delegation4().

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 }
bool_t xdr_u_hyper(XDR *xdrs, u_longlong_t *ullp)
Definition: xdr.c:878
void eprintf(LPCSTR format,...)
Definition: daemon_debug.c:86
static bool_t decode_modified_limit4(XDR *xdr, uint64_t *filesize)
Definition: nfs41_xdr.c:2053
bool_t xdr_u_int32_t(XDR *xdrs, u_int32_t *u_int32_p)
Definition: xdr.c:239
UINT32 uint32_t
Definition: types.h:75

◆ 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.

Referenced by encode_op_create_session().

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 }
#define TRUE
Definition: types.h:120
bool_t xdr_string(XDR *xdrs, char **cpp, u_int maxsize)
Definition: xdr.c:678
#define AUTH_NONE
Definition: auth.h:401
union __nfs41_callback_sec_parms::@36 u
#define NI_MAXHOST
Definition: ws2def.h:359
static double zero
Definition: j0_y0.c:96
#define AUTH_SYS
Definition: auth.h:403
bool_t xdr_u_int32_t(XDR *xdrs, u_int32_t *u_int32_p)
Definition: xdr.c:239
UINT32 uint32_t
Definition: types.h:75
struct __nfs41_callback_sec_parms::@36::__authsys_parms auth_sys
#define RPCSEC_GSS
Definition: nfs41_ops.h:867

◆ 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.

Referenced by encode_open_claim4().

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

◆ encode_component()

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

Definition at line 178 of file nfs41_xdr.c.

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().

181 {
182  uint32_t len = component->len;
183  return xdr_bytes(xdr, (char **)&component->name, &len, NFS4_OPAQUE_LIMIT);
184 }
#define NFS4_OPAQUE_LIMIT
Definition: nfs41_const.h:31
const char * name
Definition: nfs41_types.h:48
GLenum GLsizei len
Definition: glext.h:6722
UINT32 uint32_t
Definition: types.h:75
bool_t xdr_bytes(XDR *xdrs, char **cpp, u_int *sizep, u_int maxsize)
Definition: xdr.c:536
unsigned short len
Definition: nfs41_types.h:49

◆ encode_createattrs4()

static bool_t encode_createattrs4 ( XDR xdr,
nfs41_file_info createattrs 
)
static

Definition at line 1339 of file nfs41_xdr.c.

Referenced by encode_createhow4(), and encode_op_create().

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 }
#define NFS4_OPAQUE_LIMIT
Definition: nfs41_const.h:31
static bool_t encode_file_attrs(fattr4 *attrs, nfs41_file_info *info)
Definition: nfs41_xdr.c:2566
uint32_t attr_vals_len
Definition: nfs41_types.h:161
bool_t xdr_fattr4(XDR *xdr, fattr4 *fattr)
Definition: nfs41_xdr.c:144

◆ encode_createhow4()

static bool_t encode_createhow4 ( XDR xdr,
createhow4 ch 
)
static

Definition at line 1902 of file nfs41_xdr.c.

Referenced by encode_openflag4().

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:
1915  result = encode_createattrs4(xdr, ch->createattrs);
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 }
#define TRUE
Definition: types.h:120
int32_t bool_t
Definition: types.h:101
unsigned char createverf[NFS4_VERIFIER_SIZE]
Definition: nfs41_ops.h:549
#define NFS4_VERIFIER_SIZE
Definition: nfs41_const.h:30
nfs41_file_info * createattrs
Definition: nfs41_ops.h:548
bool_t xdr_opaque(XDR *xdrs, caddr_t cp, u_int cnt)
Definition: xdr.c:484
static bool_t encode_createattrs4(XDR *xdr, nfs41_file_info *createattrs)
Definition: nfs41_xdr.c:1339
bool_t xdr_u_int32_t(XDR *xdrs, u_int32_t *u_int32_p)
Definition: xdr.c:239
uint32_t mode
Definition: nfs41_ops.h:547
GLuint64EXT * result
Definition: glext.h:11304

◆ encode_createtype4()

static bool_t encode_createtype4 ( XDR xdr,
createtype4 ct 
)
static

Definition at line 1309 of file nfs41_xdr.c.

Referenced by encode_op_create().

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 }
#define TRUE
Definition: types.h:120
int32_t bool_t
Definition: types.h:101
uint32_t type
Definition: nfs41_ops.h:343
struct __createtype4::@37::__create_type_lnk lnk
specdata4 devdata
Definition: nfs41_ops.h:351
uint32_t specdata1
Definition: nfs41_ops.h:338
#define NFS4_OPAQUE_LIMIT
Definition: nfs41_const.h:31
uint32_t specdata2
Definition: nfs41_ops.h:339
union __createtype4::@37 u
bool_t xdr_u_int32_t(XDR *xdrs, u_int32_t *u_int32_p)
Definition: xdr.c:239
bool_t xdr_bytes(XDR *xdrs, char **cpp, u_int *sizep, u_int maxsize)
Definition: xdr.c:536
GLuint64EXT * result
Definition: glext.h:11304

◆ 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.

Referenced by encode_createattrs4(), and encode_op_setattr().

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;
2620  attrs->attrmask.arr[1] |= FATTR4_WORD1_TIME_CREATE;
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;
2641  attrs->attrmask.arr[1] |= FATTR4_WORD1_OWNER_GROUP;
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 }
#define xdr_getpos(xdrs)
Definition: xdr.h:201
#define TRUE
Definition: types.h:120
nfstime4 time_create
Definition: nfs41_types.h:212
bool_t xdr_u_hyper(XDR *xdrs, u_longlong_t *ullp)
Definition: xdr.c:878
unsigned char attr_vals[NFS4_OPAQUE_LIMIT]
Definition: nfs41_types.h:162
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
static bool_t xdr_settime4(XDR *xdr, nfstime4 *nt, const nfstime4 *time_delta)
Definition: nfs41_xdr.c:113
#define ZeroMemory
Definition: winbase.h:1635
void eprintf(LPCSTR format,...)
Definition: daemon_debug.c:86
nfstime4 time_modify
Definition: nfs41_types.h:213
static bool_t xdr_nfstime4(XDR *xdr, nfstime4 *nt)
Definition: nfs41_xdr.c:86
uint32_t arr[3]
Definition: nfs41_types.h:97
Definition: xdr.h:103
bitmap4 attrmask
Definition: nfs41_types.h:160
nfstime4 time_access
Definition: nfs41_types.h:211
GLenum GLclampf GLint i
Definition: glfuncs.h:14
uint32_t count
Definition: nfs41_types.h:96
static PVOID ptr
Definition: dispmode.c:27
#define NFS4_OPAQUE_LIMIT
Definition: nfs41_const.h:31
static bool_t xdr_nfsacl41(XDR *xdr, nfsacl41 *acl)
Definition: nfs41_xdr.c:327
uint32_t attr_vals_len
Definition: nfs41_types.h:161
nfsacl41 * acl
Definition: nfs41_types.h:214
Definition: xdr.h:85
uint32_t mode_mask
Definition: nfs41_types.h:231
bool_t xdr_u_int32_t(XDR *xdrs, u_int32_t *u_int32_p)
Definition: xdr.c:239
bool_t xdr_bool(XDR *xdrs, bool_t *bp)
Definition: xdr.c:428
nfstime4 * time_delta
Definition: nfs41_types.h:215
void xdrmem_create(XDR *xdrs, char *addr, u_int size, enum xdr_op op)
Definition: xdr_mem.c:94
UINT32 uint32_t
Definition: types.h:75
bool_t xdr_bytes(XDR *xdrs, char **cpp, u_int *sizep, u_int maxsize)
Definition: xdr.c:536
#define uint32_t
Definition: nsiface.idl:61

◆ 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 }
Definition: match.c:390
if(!(yy_init))
Definition: macro.lex.yy.c:717
static __inline int unexpected_op(uint32_t op, uint32_t expected)
Definition: nfs41_xdr.c:36
bool_t xdr_u_int32_t(XDR *xdrs, u_int32_t *u_int32_p)
Definition: xdr.c:239

◆ 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