ReactOS  0.4.12-dev-714-gfaac916
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.

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
static bool_t xdr_nfsace4(XDR *xdr, nfsace4 *ace)
Definition: nfs41_xdr.c:294
#define TRUE
Definition: types.h:120
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
static bool_t xdr_fsid(XDR *xdr, nfs41_fsid *fsid)
Definition: nfs41_xdr.c:166
static bool_t xdr_nfstime4(XDR *xdr, nfstime4 *nt)
Definition: nfs41_xdr.c:86
uint32_t arr[3]
Definition: nfs41_types.h:97
bitmap4 attrmask
Definition: nfs41_types.h:160
bool_t(* xdrproc_t)(XDR *,...)
Definition: xdr.h:144
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 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 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
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

Referenced by decode_op_getattr(), and decode_readdir_entry().

◆ decode_file_layout()

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

Definition at line 3322 of file nfs41_xdr.c.

3326 {
3328  u_int32_t len_ignored;
3329 
3330  if (!xdr_u_int32_t(xdr, &len_ignored))
3331  return FALSE;
3332 
3333  layout = calloc(1, sizeof(pnfs_file_layout));
3334  if (layout == NULL)
3335  return FALSE;
3336 
3337  layout->layout.offset = base->offset;
3338  layout->layout.length = base->length;
3339  layout->layout.iomode = base->iomode;
3340  layout->layout.type = base->type;
3341  list_init(&layout->layout.entry);
3342 
3343  if (!xdr_opaque(xdr, (char *)layout->deviceid, PNFS_DEVICEID_SIZE))
3344  goto out_error;
3345 
3346  if (!xdr_u_int32_t(xdr, &layout->util))
3347  goto out_error;
3348 
3349  if (!xdr_u_int32_t(xdr, &layout->first_index))
3350  goto out_error;
3351 
3352  if (!xdr_u_hyper(xdr, &layout->pattern_offset))
3353  goto out_error;
3354 
3355  if (!decode_file_layout_handles(xdr, &layout->filehandles))
3356  goto out_error;
3357 
3358  list_add_tail(list, &layout->layout.entry);
3359  return TRUE;
3360 
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
#define TRUE
Definition: types.h:120
bool_t xdr_u_hyper(XDR *xdrs, u_longlong_t *ullp)
Definition: xdr.c:878
#define free
Definition: debug_ros.c:5
#define PNFS_DEVICEID_SIZE
Definition: pnfs.h:111
__WINE_SERVER_LIST_INLINE void list_add_tail(struct list *list, struct list *elem)
Definition: list.h:102
smooth NULL
Definition: ftsmooth.c:416
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
Definition: _list.h:228
bool_t xdr_u_int32_t(XDR *xdrs, u_int32_t *u_int32_p)
Definition: xdr.c:239
#define calloc
Definition: rosglue.h:14
__WINE_SERVER_LIST_INLINE void list_init(struct list *list)
Definition: list.h:149

Referenced by decode_layout().

◆ decode_file_layout_handles()

static bool_t decode_file_layout_handles ( XDR xdr,
pnfs_file_layout_handles handles 
)
static

Definition at line 3296 of file nfs41_xdr.c.

3299 {
3300  uint32_t i, count;
3301 
3302  if (!xdr_u_int32_t(xdr, &count))
3303  return FALSE;
3304 
3305  if (count && count != handles->count) {
3306  nfs41_path_fh *tmp;
3307  tmp = realloc(handles->arr, count * sizeof(nfs41_path_fh));
3308  if (tmp == NULL)
3309  return FALSE;
3310  handles->arr = tmp;
3311  ZeroMemory(handles->arr, count * sizeof(nfs41_path_fh));
3312  handles->count = count;
3313  }
3314 
3315  for (i = 0; i < handles->count; i++) {
3316  if (!xdr_fh(xdr, &handles->arr[i].fh))
3317  return FALSE;
3318  }
3319  return TRUE;
3320 }
#define realloc
Definition: debug_ros.c:6
#define TRUE
Definition: types.h:120
GLuint GLuint GLsizei count
Definition: gl.h:1545
#define ZeroMemory
Definition: winbase.h:1635
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
smooth NULL
Definition: ftsmooth.c:416
static object_header_t ** handles
Definition: handle.c:46
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

Referenced by decode_file_layout().

◆ decode_fs_location4()

static bool_t decode_fs_location4 ( XDR xdr,
fs_location4 location 
)
static

Definition at line 377 of file nfs41_xdr.c.

380 {
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++) {
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
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define NFS41_HOSTNAME_LEN
Definition: nfs41_const.h:48
smooth NULL
Definition: ftsmooth.c:416
GLuint address
Definition: glext.h:9393
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
bool_t xdr_bytes(XDR *xdrs, char **cpp, u_int *sizep, u_int maxsize)
Definition: xdr.c:536

Referenced by decode_fs_locations4().

◆ decode_fs_locations4()

static bool_t decode_fs_locations4 ( XDR xdr,
fs_locations4 locations 
)
static

Definition at line 419 of file nfs41_xdr.c.

422 {
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
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
smooth NULL
Definition: ftsmooth.c:416
static bool_t decode_fs_location4(XDR *xdr, fs_location4 *location)
Definition: nfs41_xdr.c:377
unsigned int u_int32_t
Definition: rosdhcp.h:35
GLsizei const GLint * locations
Definition: glext.h:10542
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

Referenced by decode_file_attrs().

◆ decode_getdeviceinfo_ok()

static bool_t decode_getdeviceinfo_ok ( XDR xdr,
pnfs_getdeviceinfo_res_ok res_ok 
)
static

Definition at line 3130 of file nfs41_xdr.c.

3133 {
3134  u_int32_t len_ignored;
3135 
3136  if (!xdr_enum(xdr, (enum_t *)&res_ok->device->device.type))
3137  return FALSE;
3138 
3139  if (res_ok->device->device.type != PNFS_LAYOUTTYPE_FILE)
3140  return FALSE;
3141 
3142  if (!xdr_u_int32_t(xdr, &len_ignored))
3143  return FALSE;
3144 
3145  if (!xdr_file_device(xdr, res_ok->device))
3146  return FALSE;
3147 
3148  return xdr_bitmap4(xdr, &res_ok->notification);
3149 }
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

Referenced by decode_op_getdeviceinfo().

◆ decode_layout()

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

Definition at line 3366 of file nfs41_xdr.c.

3369 {
3371 
3372  if (!xdr_u_hyper(xdr, &layout.offset))
3373  return FALSE;
3374 
3375  if (!xdr_u_hyper(xdr, &layout.length))
3376  return FALSE;
3377 
3378  if (!xdr_enum(xdr, (enum_t *)&layout.iomode))
3379  return FALSE;
3380 
3381  if (!xdr_enum(xdr, (enum_t *)&layout.type))
3382  return FALSE;
3383 
3384  switch (layout.type) {
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 }
bool_t xdr_u_hyper(XDR *xdrs, u_longlong_t *ullp)
Definition: xdr.c:878
void eprintf(LPCSTR format,...)
Definition: daemon_debug.c:86
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
Definition: _list.h:228
static bool_t decode_file_layout(XDR *xdr, struct list_entry *list, pnfs_layout *base)
Definition: nfs41_xdr.c:3322

Referenced by decode_layout_res_ok().

◆ decode_layout_res_ok()

static bool_t decode_layout_res_ok ( XDR xdr,
pnfs_layoutget_res_ok res 
)
static

Definition at line 3395 of file nfs41_xdr.c.

3398 {
3399  uint32_t i;
3400 
3401  if (!xdr_bool(xdr, &res->return_on_close))
3402  return FALSE;
3403 
3404  if (!xdr_stateid4(xdr, &res->stateid))
3405  return FALSE;
3406 
3407  if (!xdr_u_int32_t(xdr, &res->count))
3408  return FALSE;
3409 
3410  for (i = 0; i < res->count; i++)
3411  if (!decode_layout(xdr, &res->layouts))
3412  return FALSE;
3413  return TRUE;
3414 }
#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
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
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

Referenced by decode_op_layoutget().

◆ decode_lock_res_denied()

static bool_t decode_lock_res_denied ( XDR xdr,
lock_res_denied denied 
)
static

Definition at line 1501 of file nfs41_xdr.c.

1504 {
1505  if (!xdr_u_hyper(xdr, &denied->offset))
1506  return FALSE;
1507 
1508  if (!xdr_u_hyper(xdr, &denied->length))
1509  return FALSE;
1510 
1511  if (!xdr_u_int32_t(xdr, &denied->locktype))
1512  return FALSE;
1513 
1514  return xdr_state_owner4(xdr, &denied->owner);
1515 }
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

Referenced by decode_op_lock(), and decode_op_lockt().

◆ decode_modified_limit4()

static bool_t decode_modified_limit4 ( XDR xdr,
uint64_t filesize 
)
static

Definition at line 2053 of file nfs41_xdr.c.

2056 {
2057  uint32_t blocks, bytes_per_block;
2058 
2059  if (!xdr_u_int32_t(xdr, &blocks))
2060  return FALSE;
2061 
2062  if (!xdr_u_int32_t(xdr, &bytes_per_block))
2063  return FALSE;
2064 
2065  *filesize = blocks * bytes_per_block;
2066  return TRUE;
2067 }
#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

Referenced by decode_space_limit4().

◆ decode_op_access()

static bool_t decode_op_access ( XDR xdr,
nfs_resop4 resop 
)
static

Definition at line 1207 of file nfs41_xdr.c.

1210 {
1212 
1213  if (unexpected_op(resop->op, OP_ACCESS))
1214  return FALSE;
1215 
1216  if (!xdr_u_int32_t(xdr, &res->status))
1217  return FALSE;
1218 
1219  if (res->status == NFS4_OK)
1220  {
1221  if (!xdr_u_int32_t(xdr, &res->supported))
1222  return FALSE;
1223 
1224  return xdr_u_int32_t(xdr, &res->access);
1225  }
1226  return TRUE;
1227 }
#define TRUE
Definition: types.h:120
if(!(yy_init))
Definition: macro.lex.yy.c:714
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_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:714
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_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:714
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
if(!(yy_init))
Definition: macro.lex.yy.c:714
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
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
bool_t xdr_bitmap4(XDR *xdr, bitmap4 *bitmap)
Definition: nfs41_xdr.c:48
if(!(yy_init))
Definition: macro.lex.yy.c:714
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
if(!(yy_init))
Definition: macro.lex.yy.c:714
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 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:714
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:714
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:714
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:714
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,
704  &res->server_scope_len, NFS4_OPAQUE_LIMIT);
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
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
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

◆ 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:714
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;
1892  xdrmem_create(&attr_xdr, (char *)res->obj_attributes.attr_vals, res->obj_attributes.attr_vals_len, XDR_DECODE);
1893  return decode_file_attrs(&attr_xdr, &res->obj_attributes, res->info);
1894  }
1895  return TRUE;
1896 }
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
Definition: xdr.h:103
if(!(yy_init))
Definition: macro.lex.yy.c:714
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 }
#define TRUE
Definition: types.h:120
if(!(yy_init))
Definition: macro.lex.yy.c:714
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
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 }
#define TRUE
Definition: types.h:120
if(!(yy_init))
Definition: macro.lex.yy.c:714
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:714
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
if(!(yy_init))
Definition: macro.lex.yy.c:714
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_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
static bool_t xdr_stateid4(XDR *xdr, stateid4 *si)
Definition: nfs41_xdr.c:133
if(!(yy_init))
Definition: macro.lex.yy.c:714
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:714
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
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
if(!(yy_init))
Definition: macro.lex.yy.c:714
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_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
if(!(yy_init))
Definition: macro.lex.yy.c:714
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_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
static bool_t xdr_stateid4(XDR *xdr, stateid4 *si)
Definition: nfs41_xdr.c:133
if(!(yy_init))
Definition: macro.lex.yy.c:714
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:714
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
if(!(yy_init))
Definition: macro.lex.yy.c:714
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:714
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:714
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:714
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
if(!(yy_init))
Definition: macro.lex.yy.c:714
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_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
if(!(yy_init))
Definition: macro.lex.yy.c:714
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:714
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:714
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
if(!(yy_init))
Definition: macro.lex.yy.c:714
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
if(!(yy_init))
Definition: macro.lex.yy.c:714
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:714
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:714
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
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:714
#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
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:714
#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
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:714
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:714
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
bool_t(* xdrproc_t)(XDR *,...)
Definition: xdr.h:144
if(!(yy_init))
Definition: macro.lex.yy.c:714
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
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:714
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
if(!(yy_init))
Definition: macro.lex.yy.c:714
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
static bool_t xdr_write_res_ok(XDR *xdr, nfs41_write_res_ok *res)
Definition: nfs41_xdr.c:2862

◆ decode_open_none_delegation4()

static bool_t decode_open_none_delegation4 ( XDR xdr,
open_delegation4 delegation 
)
static

Definition at line 2020 of file nfs41_xdr.c.

2023 {
2024  enum_t why_no_deleg;
2025  bool_t will_signal;
2026 
2027  if (!xdr_enum(xdr, (enum_t*)&why_no_deleg))
2028  return FALSE;
2029 
2030  switch (why_no_deleg)
2031  {
2032  case WND4_CONTENTION:
2033  case WND4_RESOURCE:
2034  return xdr_bool(xdr, &will_signal);
2035  default:
2036  return TRUE;
2037  }
2038 }
#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

Referenced by decode_op_want_delegation(), and decode_open_res_ok().

◆ decode_open_read_delegation4()

static bool_t decode_open_read_delegation4 ( XDR xdr,
open_delegation4 delegation 
)
static

Definition at line 2040 of file nfs41_xdr.c.

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

Referenced by decode_op_want_delegation(), and decode_open_res_ok().

◆ decode_open_res_ok()

static bool_t decode_open_res_ok ( XDR xdr,
nfs41_op_open_res_ok res 
)
static

Definition at line 2113 of file nfs41_xdr.c.

2116 {
2117  if (!xdr_stateid4(xdr, res->stateid))
2118  return FALSE;
2119 
2120  if (!xdr_change_info4(xdr, &res->cinfo))
2121  return FALSE;
2122 
2123  if (!xdr_u_int32_t(xdr, &res->rflags))
2124  return FALSE;
2125 
2126  if (!xdr_bitmap4(xdr, &res->attrset))
2127  return FALSE;
2128 
2129  if (!xdr_enum(xdr, (enum_t*)&res->delegation->type))
2130  return FALSE;
2131 
2132  switch (res->delegation->type)
2133  {
2134  case OPEN_DELEGATE_NONE:
2135  return TRUE;
2137  return decode_open_none_delegation4(xdr, res->delegation);
2138  case OPEN_DELEGATE_READ:
2139  return decode_open_read_delegation4(xdr, res->delegation);
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
#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
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
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
GLuint res
Definition: glext.h:9613

Referenced by decode_op_open().

◆ decode_open_write_delegation4()

static bool_t decode_open_write_delegation4 ( XDR xdr,
open_delegation4 delegation 
)
static

Definition at line 2095 of file nfs41_xdr.c.

2098 {
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

Referenced by decode_op_want_delegation(), and decode_open_res_ok().

◆ decode_pathname4()

static bool_t decode_pathname4 ( XDR xdr,
nfs41_abs_path path 
)
static

Definition at line 343 of file nfs41_xdr.c.

346 {
347  char *pos;
348  u_int32_t i, count, len, remaining;
349 
350  /* decode the number of components */
351  if (!xdr_u_int32_t(xdr, &count))
352  return FALSE;
353 
354  pos = (char *)path->path;
355  remaining = NFS41_MAX_PATH_LEN;
356 
357  /* decode each component */
358  for (i = 0; i < count; i++) {
359  len = remaining;
360  if (!xdr_bytes(xdr, (char **)&pos, &len, NFS41_MAX_PATH_LEN))
361  return FALSE;
362  remaining -= len;
363  pos += len;
364 
365  if (i < count-1) { /* add a \ between components */
366  if (remaining < 1)
367  return FALSE;
368  *pos++ = '\\';
369  remaining--;
370  }
371  }
372  path->len = (unsigned short)(NFS41_MAX_PATH_LEN - remaining);
373  return TRUE;
374 }
#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
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#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
Definition: services.c:325
bool_t xdr_bytes(XDR *xdrs, char **cpp, u_int *sizep, u_int maxsize)
Definition: xdr.c:536

Referenced by decode_fs_location4(), and decode_fs_locations4().

◆ decode_read_res_ok()

static bool_t decode_read_res_ok ( XDR xdr,
nfs41_read_res_ok res 
)
static

Definition at line 2217 of file nfs41_xdr.c.

2220 {
2221  unsigned char *data = res->data;
2222 
2223  if (!xdr_bool(xdr, &res->eof))
2224  return FALSE;
2225 
2226  return xdr_bytes(xdr, (char **)&data, &res->data_len, NFS41_MAX_FILEIO_SIZE);
2227 }
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
bool_t xdr_bool(XDR *xdrs, bool_t *bp)
Definition: xdr.c:428
GLuint res
Definition: glext.h:9613
#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

Referenced by decode_op_read().

◆ decode_readdir_entry()

static bool_t decode_readdir_entry ( XDR xdr,
readdir_entry_iterator it 
)
static

Definition at line 2283 of file nfs41_xdr.c.

2286 {
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;
2299 
2300  if (!xdr_u_hyper(xdr, &cookie))
2301  return FALSE;
2302 
2303  if (!xdr_bytes(xdr, (char **)&nameptr, &name_len, NFS4_OPAQUE_LIMIT))
2304  return FALSE;
2305 
2306  if (!xdr_fattr4(xdr, &attrs))
2307  return FALSE;
2308 
2309  if (!xdr_bool(xdr, &it->has_next_entry))
2310  return FALSE;
2311 
2312  if (it->ignore_the_rest)
2313  return TRUE;
2314 
2315  name_len += 1; /* account for null terminator */
2316  if (entry_len + name_len <= it->remaining_len)
2317  {
2318  XDR fattr_xdr;
2320  entry->cookie = cookie;
2321  entry->name_len = name_len;
2322 
2323  if (it->has_next_entry)
2324  entry->next_entry_offset = entry_len + name_len;
2325  else
2326  entry->next_entry_offset = 0;
2327 
2328  xdrmem_create(&fattr_xdr, (char *)attrs.attr_vals, attrs.attr_vals_len, XDR_DECODE);
2329  if (!(decode_file_attrs(&fattr_xdr, &attrs, &entry->attr_info)))
2330  entry->attr_info.rdattr_error = NFS4ERR_BADXDR;
2331  StringCchCopyA(entry->name, name_len, (STRSAFE_LPCSTR)name);
2332 
2333  it->buf_pos += entry_len + name_len;
2334  it->remaining_len -= entry_len + name_len;
2335  it->last_entry_offset = &entry->next_entry_offset;
2336  }
2337  else if (it->last_entry_offset)
2338  {
2339  *(it->last_entry_offset) = 0;
2340  it->ignore_the_rest = 1;
2341  }
2342 
2343  return TRUE;
2344 }
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
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
bool_t ignore_the_rest
Definition: nfs41_xdr.c:2279
unsigned char * buf_pos
Definition: nfs41_xdr.c:2276
uint32_t remaining_len
Definition: nfs41_xdr.c:2277
if(!(yy_init))
Definition: macro.lex.yy.c:714
uint32_t attr_vals_len
Definition: nfs41_types.h:161
bool_t xdr_fattr4(XDR *xdr, fattr4 *fattr)
Definition: nfs41_xdr.c:144
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

Referenced by decode_readdir_list().

◆ decode_readdir_list()

static bool_t decode_readdir_list ( XDR xdr,
nfs41_readdir_list dirs 
)
static

Definition at line 2346 of file nfs41_xdr.c.

2349 {
2351  iter.buf_pos = dirs->entries;
2352  iter.remaining_len = dirs->entries_len;
2353  iter.last_entry_offset = NULL;
2354  iter.ignore_the_rest = 0;
2355  iter.has_next_entry = 0;
2356 
2357  if (!xdr_bool(xdr, &dirs->has_entries))
2358  return FALSE;
2359 
2360  if (dirs->has_entries)
2361  {
2362  do {
2363  if (!decode_readdir_entry(xdr, &iter))
2364  return FALSE;
2365 
2366  } while (iter.has_next_entry);
2367  }
2368  dirs->entries_len -= iter.remaining_len;
2369 
2370  if (!xdr_bool(xdr, &dirs->eof))
2371  return FALSE;
2372 
2373  /* reset eof if we couldn't fit everything in the buffer */
2374  if (iter.ignore_the_rest)
2375  dirs->eof = 0;
2376  return TRUE;
2377 }
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

Referenced by decode_op_readdir().

◆ decode_space_limit4()

static bool_t decode_space_limit4 ( XDR xdr,
uint64_t filesize 
)
static

Definition at line 2074 of file nfs41_xdr.c.

2077 {
2078  uint32_t limitby;
2079 
2080  if (!xdr_u_int32_t(xdr, &limitby))
2081  return FALSE;
2082 
2083  switch (limitby)
2084  {
2085  case NFS_LIMIT_SIZE:
2086  return xdr_u_hyper(xdr, filesize);
2087  case NFS_LIMIT_BLOCKS:
2088  return decode_modified_limit4(xdr, filesize);
2089  default:
2090  eprintf("decode_space_limit4: limitby %d invalid\n", limitby);
2091  return FALSE;
2092  }
2093 }
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

Referenced by decode_open_write_delegation4().

◆ encode_backchannel_sec_parms()

static bool_t encode_backchannel_sec_parms ( XDR xdr,
nfs41_callback_secparms args 
)
static

Definition at line 774 of file nfs41_xdr.c.

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

Referenced by encode_op_create_session().

◆ encode_claim_deleg_cur()

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

Definition at line 1950 of file nfs41_xdr.c.

1954 {
1955  if (!xdr_stateid4(xdr, stateid))
1956  return FALSE;
1957  return encode_component(xdr, name);
1958 }
static bool_t 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
Definition: name.c:36

Referenced by encode_open_claim4().

◆ encode_component()

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

Definition at line 178 of file nfs41_xdr.c.

181 {
182  uint32_t len = component->len;
183  return xdr_bytes(xdr, (char **)&component->name, &len, NFS4_OPAQUE_LIMIT);
184 }
#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

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

◆ encode_createattrs4()

static bool_t encode_createattrs4 ( XDR xdr,
nfs41_file_info createattrs 
)
static

Definition at line 1339 of file nfs41_xdr.c.

1342 {
1343  fattr4 attrs;
1344 
1345  /* encode attribute values from createattrs->info into attrs.attr_vals */
1347  if (!encode_file_attrs(&attrs, createattrs))
1348  return FALSE;
1349 
1350  return xdr_fattr4(xdr, &attrs);
1351 }
#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

Referenced by encode_createhow4(), and encode_op_create().

◆ encode_createhow4()

static bool_t encode_createhow4 ( XDR xdr,
createhow4 ch 
)
static

Definition at line 1902 of file nfs41_xdr.c.

1905 {
1906  bool_t result = TRUE;
1907 
1908  if (!xdr_u_int32_t(xdr, &ch->mode))
1909  return FALSE;
1910 
1911  switch (ch->mode)
1912  {
1913  case UNCHECKED4:
1914  case GUARDED4:
1916  break;
1917  case EXCLUSIVE4:
1918  result = xdr_opaque(xdr, (char *)ch->createverf, NFS4_VERIFIER_SIZE);
1919  break;
1920  case EXCLUSIVE4_1:
1921  if (!xdr_opaque(xdr, (char *)ch->createverf, NFS4_VERIFIER_SIZE))
1922  return FALSE;
1923  if (!encode_createattrs4(xdr, ch->createattrs))
1924  return FALSE;
1925  break;
1926  }
1927  return result;
1928 }
#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

Referenced by encode_openflag4().

◆ encode_createtype4()

static bool_t encode_createtype4 ( XDR xdr,
createtype4 ct 
)
static

Definition at line 1309 of file nfs41_xdr.c.

1312 {
1313  bool_t result = TRUE;
1314  const char *linkdata;
1315 
1316  if (!xdr_u_int32_t(xdr, &ct->type))
1317  return FALSE;
1318 
1319  switch (ct->type)
1320  {
1321  case NF4LNK:
1322  linkdata = ct->u.lnk.linkdata;
1323  result = xdr_bytes(xdr, (char**)&linkdata, &ct->u.lnk.linkdata_len,
1325  break;
1326  case NF4BLK:
1327  case NF4CHR:
1328  result = xdr_u_int32_t(xdr, &ct->u.devdata.specdata1);
1329  if (result == TRUE)
1330  result = xdr_u_int32_t(xdr, &ct->u.devdata.specdata2);
1331  break;
1332  default:
1333  // Some types need no further action
1334  break;
1335  }
1336  return result;
1337 }
#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

Referenced by encode_op_create().

◆ encode_file_attrs()

static bool_t encode_file_attrs ( fattr4 attrs,
nfs41_file_info info 
)
static

Definition at line 2566 of file nfs41_xdr.c.

2569 {
2570  uint32_t i;
2571  XDR localxdr;
2572 
2573  xdrmem_create(&localxdr, (char *)attrs->attr_vals, NFS4_OPAQUE_LIMIT, XDR_ENCODE);
2574 
2575  attrs->attr_vals_len = 0;
2576  ZeroMemory(&attrs->attrmask, sizeof(bitmap4));
2577  attrs->attrmask.count = info->attrmask.count;
2578 
2579  if (info->attrmask.count > 0) {
2580  if (info->attrmask.arr[0] & FATTR4_WORD0_SIZE) {
2581  if (!xdr_u_hyper(&localxdr, &info->size))
2582  return FALSE;
2583  attrs->attrmask.arr[0] |= FATTR4_WORD0_SIZE;
2584  }
2585  if (info->attrmask.arr[0] & FATTR4_WORD0_ACL) {
2586  if (!xdr_nfsacl41(&localxdr, info->acl))
2587  return FALSE;
2588  attrs->attrmask.arr[0] |= FATTR4_WORD0_ACL;
2589  }
2590  if (info->attrmask.arr[0] & FATTR4_WORD0_ARCHIVE) {
2591  if (!xdr_bool(&localxdr, &info->archive))
2592  return FALSE;
2593  attrs->attrmask.arr[0] |= FATTR4_WORD0_ARCHIVE;
2594  }
2595  if (info->attrmask.arr[0] & FATTR4_WORD0_HIDDEN) {
2596  if (!xdr_bool(&localxdr, &info->hidden))
2597  return FALSE;
2598  attrs->attrmask.arr[0] |= FATTR4_WORD0_HIDDEN;
2599  }
2600  }
2601  if (info->attrmask.count > 1) {
2602  if (info->attrmask.arr[1] & FATTR4_WORD1_MODE) {
2603  if (!xdr_u_int32_t(&localxdr, &info->mode))
2604  return FALSE;
2605  attrs->attrmask.arr[1] |= FATTR4_WORD1_MODE;
2606  }
2607  if (info->attrmask.arr[1] & FATTR4_WORD1_SYSTEM) {
2608  if (!xdr_bool(&localxdr, &info->system))
2609  return FALSE;
2610  attrs->attrmask.arr[1] |= FATTR4_WORD1_SYSTEM;
2611  }
2612  if (info->attrmask.arr[1] & FATTR4_WORD1_TIME_ACCESS_SET) {
2613  if (!xdr_settime4(&localxdr, &info->time_access, info->time_delta))
2614  return FALSE;
2616  }
2617  if (info->attrmask.arr[1] & FATTR4_WORD1_TIME_CREATE) {
2618  if (!xdr_nfstime4(&localxdr, &info->time_create))
2619  return FALSE;
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
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
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
unsigned int count
Definition: notification.c:64
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
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
Definition: xdr.h:85
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
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

Referenced by encode_createattrs4(), and encode_op_setattr().

◆ encode_op_access()

static bool_t encode_op_access ( XDR xdr,
nfs_argop4 argop 
)
static

Definition at line 1195 of file nfs41_xdr.c.

1198 {
1200 
1201  if (unexpected_op(argop->op, OP_ACCESS))
1202  return FALSE;
1203 
1204  return xdr_u_int32_t(xdr, &args->access);
1205 }
Definition: match.c:390
if(!(yy_init))
Definition: macro.lex.yy.c:714
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 
886  return FALSE;
887 
888  if (!xdr_opaque(xdr, (char *)args->sessionid, NFS4_SESSIONID_SIZE))
889  return FALSE;
890 
891  if (!xdr_enum(xdr, (enum_t *)&args->dir))
892  return FALSE;
893 
894  return xdr_u_int32_t(xdr, &zero); /* bctsa_use_conn_in_rdma_mode = false */
895 }
#define NFS4_SESSIONID_SIZE
Definition: nfs41_const.h:32
Definition: match.c:390
bool_t xdr_enum(XDR *xdrs, enum_t *ep)
Definition: xdr.c:458
if(!(yy_init))
Definition: macro.lex.yy.c:714
static double zero
Definition: j0_y0.c:96
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_opaque(XDR *xdrs, caddr_t cp, u_int cnt)
Definition: xdr.c:484
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_op_close()

static bool_t encode_op_close ( XDR xdr,
nfs_argop4 argop 
)
static

Definition at line 1233 of file nfs41_xdr.c.

1236 {
1238  uint32_t zero = 0;
1239 
1240  if (unexpected_op(argop->op, OP_CLOSE))
1241  return FALSE;
1242 
1243  if (!xdr_u_int32_t(xdr, &zero)) // This should be ignored by server
1244  return FALSE;
1245 
1246  return xdr_stateid4(xdr, &args->stateid->stateid);
1247 }
Definition: match.c:390
static bool_t xdr_stateid4(XDR *xdr, stateid4 *si)
Definition: nfs41_xdr.c:133
if(!(yy_init))
Definition: macro.lex.yy.c:714
static double zero
Definition: j0_y0.c:96
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

◆ encode_op_commit()

static bool_t encode_op_commit ( XDR xdr,
nfs_argop4 argop 
)
static

Definition at line 1272 of file nfs41_xdr.c.

1275 {
1277 
1278  if (unexpected_op(argop->op, OP_COMMIT))
1279  return FALSE;
1280 
1281  if (!xdr_u_hyper(xdr, &args->offset))
1282  return FALSE;
1283 
1284  return xdr_u_int32_t(xdr, &args->count);
1285 }
bool_t xdr_u_hyper(XDR *xdrs, u_longlong_t *ullp)
Definition: xdr.c:878
Definition: match.c:390
if(!(yy_init))
Definition: macro.lex.yy.c:714
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_create()

static bool_t encode_op_create ( XDR xdr,
nfs_argop4 argop 
)
static

Definition at line 1353 of file nfs41_xdr.c.

1356 {
1358 
1359  if (unexpected_op(argop->op, OP_CREATE))
1360  return FALSE;
1361 
1362  if (!encode_createtype4(xdr, &args->objtype))
1363  return FALSE;
1364 
1365  if (!encode_component(xdr, args->name))
1366  return FALSE;
1367 
1368  return encode_createattrs4(xdr, args->createattrs);
1369 }
static bool_t encode_createtype4(XDR *xdr, createtype4 *ct)
Definition: nfs41_xdr.c:1309
Definition: match.c:390
static bool_t encode_component(XDR *xdr, const nfs41_component *component)
Definition: nfs41_xdr.c:178
if(!(yy_init))
Definition: macro.lex.yy.c:714
static __inline int unexpected_op(uint32_t op, uint32_t expected)
Definition: nfs41_xdr.c:36
static bool_t encode_createattrs4(XDR *xdr, nfs41_file_info *createattrs)
Definition: nfs41_xdr.c:1339

◆ encode_op_create_session()

static bool_t encode_op_create_session ( XDR xdr,
nfs_argop4 argop 
)
static

Definition at line 798 of file nfs41_xdr.c.

801 {
803  nfs41_callback_secparms *cb_secparams = args->csa_cb_secparams;
804  uint32_t cb_count = 2;
805 
807  return FALSE;
808 
809  /* clientid4 csa_clientid */
810  if (!xdr_u_hyper(xdr, &args->csa_clientid))
811  return FALSE;
812 
813  /* sequenceid4 csa_sequence */
814  if (!xdr_u_int32_t(xdr, &args->csa_sequence))
815  return FALSE;
816 
817  /* TODO: uint32_t csa_flags = 0 */
818  if (!xdr_u_int32_t(xdr, &args->csa_flags))
819  return FALSE;
820 
821  /* channel_attrs4 csa_fore_chan_attrs */
822  if (!xdr_channel_attrs4(xdr, &args->csa_fore_chan_attrs))
823  return FALSE;
824 
825  /* channel_attrs4 csa_back_chan_attrs */
826  if (!xdr_channel_attrs4(xdr, &args->csa_back_chan_attrs))
827  return FALSE;
828 
829  /* TODO: uint32_t csa_cb_program = 1234 */
830  if (!xdr_u_int32_t(xdr, &args->csa_cb_program))
831  return FALSE;
832 
833  return xdr_array(xdr, (char **)&cb_secparams, &cb_count,
835 }
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
bool_t xdr_u_hyper(XDR *xdrs, u_longlong_t *ullp)
Definition: xdr.c:878
Definition: match.c:390
bool_t(* xdrproc_t)(XDR *,...)
Definition: xdr.h:144
static bool_t encode_backchannel_sec_parms(XDR *xdr, nfs41_callback_secparms *args)
Definition: nfs41_xdr.c:774
if(!(yy_init))
Definition: macro.lex.yy.c:714
static WORD cb_count
Definition: loader.c:52
static __inline int unexpected_op(uint32_t op, uint32_t expected)
Definition: nfs41_xdr.c:36
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

◆ encode_op_delegpurge()

static bool_t encode_op_delegpurge ( XDR xdr,
nfs_argop4 argop 
)
static

Definition at line 1636 of file nfs41_xdr.c.

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

◆ encode_op_delegreturn()

static bool_t encode_op_delegreturn ( XDR xdr,
nfs_argop4 argop 
)
static

Definition at line 1666 of file nfs41_xdr.c.

1669 {
1671 
1672  if (unexpected_op(argop->op, OP_DELEGRETURN))
1673  return FALSE;
1674 
1675  return xdr_stateid4(xdr, &args->stateid->stateid);
1676 }
Definition: match.c:390
static bool_t xdr_stateid4(XDR *xdr, stateid4 *si)
Definition: nfs41_xdr.c:133
if(!(yy_init))
Definition: macro.lex.yy.c:714
static __inline int unexpected_op(uint32_t op, uint32_t expected)
Definition: nfs41_xdr.c:36

◆ encode_op_destroy_clientid()

static bool_t encode_op_destroy_clientid ( XDR xdr,
nfs_argop4 argop 
)
static

Definition at line 955 of file nfs41_xdr.c.

958 {
960 
962  return FALSE;
963 
964  return xdr_u_hyper(xdr, &args->dca_clientid);
965 }
bool_t xdr_u_hyper(XDR *xdrs, u_longlong_t *ullp)
Definition: xdr.c:878