ReactOS 0.4.15-dev-7953-g1f49173
callback_xdr.c File Reference
#include "nfs41_callback.h"
#include "nfs41_ops.h"
#include "util.h"
#include "daemon_debug.h"
Include dependency graph for callback_xdr.c:

Go to the source code of this file.

Macros

#define CBXLVL   2 /* dprintf level for callback xdr logging */
 
#define CBX_ERR(msg)   dprintf((CBXLVL), __FUNCTION__ ": failed at " msg "\n")
 

Functions

bool_t xdr_bitmap4 (XDR *xdr, bitmap4 *bitmap)
 
bool_t xdr_fattr4 (XDR *xdr, fattr4 *fattr)
 
static bool_t common_stateid (XDR *xdr, stateid4 *stateid)
 
static bool_t common_fh (XDR *xdr, nfs41_fh *fh)
 
static bool_t common_fsid (XDR *xdr, nfs41_fsid *fsid)
 
static bool_t common_notify4 (XDR *xdr, struct notify4 *notify)
 
static bool_t op_cb_layoutrecall_file (XDR *xdr, struct cb_recall_file *args)
 
static bool_t op_cb_layoutrecall_fsid (XDR *xdr, union cb_recall_file_args *args)
 
static bool_t op_cb_layoutrecall_args (XDR *xdr, struct cb_layoutrecall_args *args)
 
static bool_t op_cb_layoutrecall_res (XDR *xdr, struct cb_layoutrecall_res *res)
 
static bool_t op_cb_recall_slot_args (XDR *xdr, struct cb_recall_slot_args *res)
 
static bool_t op_cb_recall_slot_res (XDR *xdr, struct cb_recall_slot_res *res)
 
static bool_t op_cb_sequence_ref (XDR *xdr, struct cb_sequence_ref *args)
 
static bool_t op_cb_sequence_ref_list (XDR *xdr, struct cb_sequence_ref_list *args)
 
static bool_t op_cb_sequence_args (XDR *xdr, struct cb_sequence_args *args)
 
static bool_t op_cb_sequence_res_ok (XDR *xdr, struct cb_sequence_res_ok *res)
 
static bool_t op_cb_sequence_res (XDR *xdr, struct cb_sequence_res *res)
 
static bool_t op_cb_getattr_args (XDR *xdr, struct cb_getattr_args *args)
 
static bool_t info_to_fattr4 (nfs41_file_info *info, fattr4 *fattr)
 
static bool_t op_cb_getattr_res (XDR *xdr, struct cb_getattr_res *res)
 
static bool_t op_cb_recall_args (XDR *xdr, struct cb_recall_args *args)
 
static bool_t op_cb_recall_res (XDR *xdr, struct cb_recall_res *res)
 
static bool_t op_cb_notify_args (XDR *xdr, struct cb_notify_args *res)
 
static bool_t op_cb_notify_res (XDR *xdr, struct cb_notify_res *res)
 
static bool_t op_cb_push_deleg_args (XDR *xdr, struct cb_push_deleg_args *res)
 
static bool_t op_cb_push_deleg_res (XDR *xdr, struct cb_push_deleg_res *res)
 
static bool_t op_cb_recall_any_args (XDR *xdr, struct cb_recall_any_args *res)
 
static bool_t op_cb_recall_any_res (XDR *xdr, struct cb_recall_any_res *res)
 
static bool_t op_cb_recallable_obj_avail_args (XDR *xdr, struct cb_recallable_obj_avail_args *res)
 
static bool_t op_cb_recallable_obj_avail_res (XDR *xdr, struct cb_recallable_obj_avail_res *res)
 
static bool_t op_cb_wants_cancelled_args (XDR *xdr, struct cb_wants_cancelled_args *res)
 
static bool_t op_cb_wants_cancelled_res (XDR *xdr, struct cb_wants_cancelled_res *res)
 
static bool_t op_cb_notify_lock_args (XDR *xdr, struct cb_notify_lock_args *res)
 
static bool_t op_cb_notify_lock_res (XDR *xdr, struct cb_notify_lock_res *res)
 
static bool_t cb_notify_deviceid_change (XDR *xdr, struct notify_deviceid4 *change)
 
static bool_t cb_notify_deviceid_delete (XDR *xdr, struct notify_deviceid4 *change)
 
static bool_t op_cb_notify_deviceid_args (XDR *xdr, struct cb_notify_deviceid_args *args)
 
static bool_t op_cb_notify_deviceid_res (XDR *xdr, struct cb_notify_deviceid_res *res)
 
static bool_t cb_compound_tag (XDR *xdr, struct cb_compound_tag *args)
 
static bool_t cb_compound_argop (XDR *xdr, struct cb_argop *args)
 
bool_t proc_cb_compound_args (XDR *xdr, struct cb_compound_args *args)
 
static bool_t cb_compound_resop (XDR *xdr, struct cb_resop *res)
 
bool_t proc_cb_compound_res (XDR *xdr, struct cb_compound_res *res)
 

Variables

static const struct xdr_discrim cb_layoutrecall_discrim []
 
static const struct xdr_discrim cb_sequence_res_discrim []
 
static const struct xdr_discrim cb_argop_discrim []
 
static const struct xdr_discrim cb_resop_discrim []
 

Macro Definition Documentation

◆ CBX_ERR

#define CBX_ERR (   msg)    dprintf((CBXLVL), __FUNCTION__ ": failed at " msg "\n")

Definition at line 32 of file callback_xdr.c.

◆ CBXLVL

#define CBXLVL   2 /* dprintf level for callback xdr logging */

Definition at line 28 of file callback_xdr.c.

Function Documentation

◆ cb_compound_argop()

static bool_t cb_compound_argop ( XDR xdr,
struct cb_argop args 
)
static

Definition at line 579 of file callback_xdr.c.

580{
582
583 result = xdr_union(xdr, &args->opnum, (char*)&args->args,
585 if (!result) { CBX_ERR("cmb:argop.args"); goto out; }
586out:
587 return result;
588}
bool_t xdr_union(XDR *xdrs, enum_t *dscmp, char *unp, const struct xdr_discrim *choices, xdrproc_t dfault)
Definition: xdr.c:629
static const struct xdr_discrim cb_argop_discrim[]
Definition: callback_xdr.c:563
#define CBX_ERR(msg)
Definition: callback_xdr.c:32
int32_t bool_t
Definition: types.h:101
GLuint64EXT * result
Definition: glext.h:11304
static FILE * out
Definition: regtests2xml.c:44
Definition: match.c:390
#define NULL_xdrproc_t
Definition: xdr.h:246

Referenced by proc_cb_compound_args().

◆ cb_compound_resop()

static bool_t cb_compound_resop ( XDR xdr,
struct cb_resop res 
)
static

Definition at line 628 of file callback_xdr.c.

629{
630 /* save xdr encode/decode status to see which operation failed */
631 res->xdr_ok = xdr_union(xdr, &res->opnum, (char*)&res->res,
633 if (!res->xdr_ok) { CBX_ERR("resop.res"); goto out; }
634out:
635 return res->xdr_ok;
636}
static const struct xdr_discrim cb_resop_discrim[]
Definition: callback_xdr.c:612
GLuint res
Definition: glext.h:9613

Referenced by proc_cb_compound_res().

◆ cb_compound_tag()

static bool_t cb_compound_tag ( XDR xdr,
struct cb_compound_tag args 
)
static

Definition at line 556 of file callback_xdr.c.

557{
558 return xdr_u_int32_t(xdr, &args->len)
559 && args->len <= CB_COMPOUND_MAX_TAG
560 && xdr_opaque(xdr, args->str, args->len);
561}
bool_t xdr_u_int32_t(XDR *xdrs, u_int32_t *u_int32_p)
Definition: xdr.c:239
bool_t xdr_opaque(XDR *xdrs, caddr_t cp, u_int cnt)
Definition: xdr.c:484
#define CB_COMPOUND_MAX_TAG

◆ cb_notify_deviceid_change()

static bool_t cb_notify_deviceid_change ( XDR xdr,
struct notify_deviceid4 change 
)
static

Definition at line 461 of file callback_xdr.c.

462{
464
465 result = xdr_u_int32_t(xdr, (uint32_t*)&change->layouttype);
466 if (!result) { CBX_ERR("notify_deviceid.change.layouttype"); goto out; }
467
468 result = xdr_opaque(xdr, (char*)change->deviceid, PNFS_DEVICEID_SIZE);
469 if (!result) { CBX_ERR("notify_deviceid.change.deviceid"); goto out; }
470
471 result = xdr_bool(xdr, &change->immediate);
472 if (!result) { CBX_ERR("notify_deviceid.change.immediate"); goto out; }
473out:
474 return result;
475}
bool_t xdr_bool(XDR *xdrs, bool_t *bp)
Definition: xdr.c:428
UINT32 uint32_t
Definition: types.h:75
#define PNFS_DEVICEID_SIZE
Definition: pnfs.h:111
enum pnfs_layout_type layouttype
unsigned char deviceid[16]

Referenced by op_cb_notify_deviceid_args().

◆ cb_notify_deviceid_delete()

static bool_t cb_notify_deviceid_delete ( XDR xdr,
struct notify_deviceid4 change 
)
static

Definition at line 477 of file callback_xdr.c.

478{
480
481 result = xdr_u_int32_t(xdr, (uint32_t*)&change->layouttype);
482 if (!result) { CBX_ERR("notify_deviceid.delete.layouttype"); goto out; }
483
484 result = xdr_opaque(xdr, (char*)change->deviceid, PNFS_DEVICEID_SIZE);
485 if (!result) { CBX_ERR("notify_deviceid.delete.deviceid"); goto out; }
486out:
487 return result;
488}

Referenced by op_cb_notify_deviceid_args().

◆ common_fh()

static bool_t common_fh ( XDR xdr,
nfs41_fh fh 
)
static

Definition at line 45 of file callback_xdr.c.

46{
47 return xdr_u_int32_t(xdr, &fh->len)
48 && fh->len <= NFS4_FHSIZE
49 && xdr_opaque(xdr, (char*)fh->fh, fh->len);
50}
#define NFS4_FHSIZE
Definition: nfs41_const.h:29
uint32_t len
Definition: nfs41_types.h:54
unsigned char fh[NFS4_FHSIZE]
Definition: nfs41_types.h:53

Referenced by op_cb_getattr_args(), op_cb_layoutrecall_file(), and op_cb_recall_args().

◆ common_fsid()

static bool_t common_fsid ( XDR xdr,
nfs41_fsid fsid 
)
static

Definition at line 52 of file callback_xdr.c.

53{
54 return xdr_u_int64_t(xdr, &fsid->major)
55 && xdr_u_int64_t(xdr, &fsid->minor);
56}
bool_t xdr_u_int64_t(XDR *xdrs, u_int64_t *ullp)
Definition: xdr.c:828
uint64_t major
Definition: nfs41_types.h:66
uint64_t minor
Definition: nfs41_types.h:67

Referenced by op_cb_layoutrecall_fsid().

◆ common_notify4()

static bool_t common_notify4 ( XDR xdr,
struct notify4 notify 
)
static

Definition at line 58 of file callback_xdr.c.

59{
60 return xdr_bitmap4(xdr, &notify->mask)
61 && xdr_bytes(xdr, &notify->list, &notify->len, NFS4_OPAQUE_LIMIT);
62}
bool_t xdr_bytes(XDR *xdrs, char **cpp, u_int *sizep, u_int maxsize)
Definition: xdr.c:536
bool_t xdr_bitmap4(XDR *xdr, bitmap4 *bitmap)
Definition: nfs41_xdr.c:48
int notify
Definition: msacm.c:1366
#define NFS4_OPAQUE_LIMIT
Definition: nfs41_const.h:31

Referenced by op_cb_notify_deviceid_args().

◆ common_stateid()

static bool_t common_stateid ( XDR xdr,
stateid4 stateid 
)
static

Definition at line 39 of file callback_xdr.c.

40{
41 return xdr_u_int32_t(xdr, &stateid->seqid)
42 && xdr_opaque(xdr, (char*)stateid->other, NFS4_STATEID_OTHER);
43}
#define NFS4_STATEID_OTHER
Definition: nfs41_const.h:33
unsigned char other[NFS4_STATEID_OTHER]
Definition: nfs41_types.h:145
uint32_t seqid
Definition: nfs41_types.h:144

Referenced by op_cb_layoutrecall_file(), and op_cb_recall_args().

◆ info_to_fattr4()

static bool_t info_to_fattr4 ( nfs41_file_info info,
fattr4 fattr 
)
static

Definition at line 261 of file callback_xdr.c.

262{
263 XDR fattr_xdr;
265
266 /* encode nfs41_file_info into fattr4 */
267 xdrmem_create(&fattr_xdr, (char*)fattr->attr_vals,
269
270 /* The only attributes that the server can reliably
271 * query via CB_GETATTR are size and change. */
272 if (bitmap_isset(&info->attrmask, 0, FATTR4_WORD0_CHANGE)) {
273 result = xdr_u_hyper(&fattr_xdr, &info->change);
274 if (!result) { CBX_ERR("getattr.info.change"); goto out; }
275 bitmap_set(&fattr->attrmask, 0, FATTR4_WORD0_CHANGE);
276 }
277 if (bitmap_isset(&info->attrmask, 0, FATTR4_WORD0_SIZE)) {
278 result = xdr_u_hyper(&fattr_xdr, &info->size);
279 if (!result) { CBX_ERR("getattr.info.size"); goto out; }
280 bitmap_set(&fattr->attrmask, 0, FATTR4_WORD0_SIZE);
281 }
282 fattr->attr_vals_len = xdr_getpos(&fattr_xdr);
283out:
284 return result;
285}
bool_t xdr_u_hyper(XDR *xdrs, u_longlong_t *ullp)
Definition: xdr.c:878
static __inline bool_t bitmap_isset(IN const bitmap4 *mask, IN uint32_t word, IN uint32_t flag)
Definition: util.h:55
static __inline void bitmap_set(IN bitmap4 *mask, IN uint32_t word, IN uint32_t flag)
Definition: util.h:62
#define TRUE
Definition: types.h:120
@ FATTR4_WORD0_CHANGE
Definition: nfs41_const.h:210
@ FATTR4_WORD0_SIZE
Definition: nfs41_const.h:211
Definition: xdr.h:103
Definition: fatfs.h:133
@ XDR_ENCODE
Definition: xdr.h:85
#define xdr_getpos(xdrs)
Definition: xdr.h:201
void xdrmem_create(XDR *xdrs, char *addr, u_int size, enum xdr_op op)
Definition: xdr_mem.c:94

Referenced by op_cb_getattr_res().

◆ op_cb_getattr_args()

static bool_t op_cb_getattr_args ( XDR xdr,
struct cb_getattr_args args 
)
static

Definition at line 248 of file callback_xdr.c.

249{
251
252 result = common_fh(xdr, &args->fh);
253 if (!result) { CBX_ERR("getattr.fh"); goto out; }
254
255 result = xdr_bitmap4(xdr, &args->attr_request);
256 if (!result) { CBX_ERR("getattr.attr_request"); goto out; }
257out:
258 return result;
259}
static bool_t common_fh(XDR *xdr, nfs41_fh *fh)
Definition: callback_xdr.c:45

◆ op_cb_getattr_res()

static bool_t op_cb_getattr_res ( XDR xdr,
struct cb_getattr_res res 
)
static

Definition at line 287 of file callback_xdr.c.

288{
290
291 result = xdr_enum(xdr, &res->status);
292 if (!result) { CBX_ERR("getattr.status"); goto out; }
293
294 if (res->status == NFS4_OK) {
295 fattr4 fattr = { 0 };
296
297 result = info_to_fattr4(&res->info, &fattr);
298 if (!result) { goto out; }
299
300 result = xdr_fattr4(xdr, &fattr);
301 if (!result) { CBX_ERR("getattr.obj_attributes"); goto out; }
302 }
303out:
304 return result;
305}
bool_t xdr_enum(XDR *xdrs, enum_t *ep)
Definition: xdr.c:458
static bool_t info_to_fattr4(nfs41_file_info *info, fattr4 *fattr)
Definition: callback_xdr.c:261
bool_t xdr_fattr4(XDR *xdr, fattr4 *fattr)
Definition: nfs41_xdr.c:144
@ NFS4_OK
Definition: nfs41_const.h:87

◆ op_cb_layoutrecall_args()

static bool_t op_cb_layoutrecall_args ( XDR xdr,
struct cb_layoutrecall_args args 
)
static

Definition at line 101 of file callback_xdr.c.

102{
104
105 result = xdr_enum(xdr, (enum_t*)&args->type);
106 if (!result) { CBX_ERR("layoutrecall_args.type"); goto out; }
107
108 result = xdr_enum(xdr, (enum_t*)&args->iomode);
109 if (!result) { CBX_ERR("layoutrecall_args.iomode"); goto out; }
110
111 result = xdr_bool(xdr, &args->changed);
112 if (!result) { CBX_ERR("layoutrecall_args.changed"); goto out; }
113
114 result = xdr_union(xdr, (enum_t*)&args->recall.type,
115 (char*)&args->recall.args, cb_layoutrecall_discrim, NULL_xdrproc_t);
116 if (!result) { CBX_ERR("layoutrecall_args.recall"); goto out; }
117out:
118 return result;
119}
static const struct xdr_discrim cb_layoutrecall_discrim[]
Definition: callback_xdr.c:94
int32_t enum_t
Definition: types.h:102

◆ op_cb_layoutrecall_file()

static bool_t op_cb_layoutrecall_file ( XDR xdr,
struct cb_recall_file args 
)
static

Definition at line 65 of file callback_xdr.c.

66{
68
69 result = common_fh(xdr, &args->fh);
70 if (!result) { CBX_ERR("layoutrecall_file.fh"); goto out; }
71
72 result = xdr_u_int64_t(xdr, &args->offset);
73 if (!result) { CBX_ERR("layoutrecall_file.offset"); goto out; }
74
76 if (!result) { CBX_ERR("layoutrecall_file.length"); goto out; }
77
78 result = common_stateid(xdr, &args->stateid);
79 if (!result) { CBX_ERR("layoutrecall_file.stateid"); goto out; }
80out:
81 return result;
82}
static bool_t common_stateid(XDR *xdr, stateid4 *stateid)
Definition: callback_xdr.c:39
int length
Definition: match.c:394

◆ op_cb_layoutrecall_fsid()

static bool_t op_cb_layoutrecall_fsid ( XDR xdr,
union cb_recall_file_args args 
)
static

Definition at line 84 of file callback_xdr.c.

85{
87
88 result = common_fsid(xdr, &args->fsid);
89 if (!result) { CBX_ERR("layoutrecall_fsid.fsid"); goto out; }
90out:
91 return result;
92}
static bool_t common_fsid(XDR *xdr, nfs41_fsid *fsid)
Definition: callback_xdr.c:52

◆ op_cb_layoutrecall_res()

static bool_t op_cb_layoutrecall_res ( XDR xdr,
struct cb_layoutrecall_res res 
)
static

Definition at line 121 of file callback_xdr.c.

122{
124
125 result = xdr_enum(xdr, &res->status);
126 if (!result) { CBX_ERR("layoutrecall_res.status"); goto out; }
127out:
128 return result;
129}

◆ op_cb_notify_args()

static bool_t op_cb_notify_args ( XDR xdr,
struct cb_notify_args res 
)
static

Definition at line 335 of file callback_xdr.c.

336{
338
339 result = xdr_u_int32_t(xdr, &res->target_highest_slotid);
340 if (!result) { CBX_ERR("notify.target_highest_slotid"); goto out; }
341out:
342 return result;
343}

◆ op_cb_notify_deviceid_args()

static bool_t op_cb_notify_deviceid_args ( XDR xdr,
struct cb_notify_deviceid_args args 
)
static

Definition at line 490 of file callback_xdr.c.

491{
492 XDR notify_xdr;
493 uint32_t i, j, c;
495
496 /* decode the generic notify4 list */
497 result = xdr_array(xdr, (char**)&args->notify_list,
498 &args->notify_count, CB_COMPOUND_MAX_OPERATIONS,
499 sizeof(struct notify4), (xdrproc_t)common_notify4);
500 if (!result) { CBX_ERR("notify_deviceid.notify_list"); goto out; }
501
502 switch (xdr->x_op) {
503 case XDR_FREE:
504 free(args->change_list);
505 case XDR_ENCODE:
506 return TRUE;
507 }
508
509 /* count the number of device changes */
510 args->change_count = 0;
511 for (i = 0; i < args->notify_count; i++)
512 args->change_count += args->notify_list[i].mask.count;
513
514 args->change_list = calloc(args->change_count, sizeof(struct notify_deviceid4));
515 if (args->change_list == NULL)
516 return FALSE;
517
518 c = 0;
519 for (i = 0; i < args->notify_count; i++) {
520 struct notify4 *notify = &args->notify_list[i];
521
522 /* decode the device notifications out of the opaque buffer */
523 xdrmem_create(&notify_xdr, notify->list, notify->len, XDR_DECODE);
524
525 for (j = 0; j < notify->mask.count; j++) {
526 struct notify_deviceid4 *change = &args->change_list[c++];
527 change->type = notify->mask.arr[j];
528
529 switch (change->type) {
531 result = cb_notify_deviceid_change(&notify_xdr, change);
532 if (!result) { CBX_ERR("notify_deviceid.change"); goto out; }
533 break;
535 result = cb_notify_deviceid_delete(&notify_xdr, change);
536 if (!result) { CBX_ERR("notify_deviceid.delete"); goto out; }
537 break;
538 }
539 }
540 }
541out:
542 return result;
543}
static bool_t cb_notify_deviceid_change(XDR *xdr, struct notify_deviceid4 *change)
Definition: callback_xdr.c:461
static bool_t cb_notify_deviceid_delete(XDR *xdr, struct notify_deviceid4 *change)
Definition: callback_xdr.c:477
static bool_t common_notify4(XDR *xdr, struct notify4 *notify)
Definition: callback_xdr.c:58
#define free
Definition: debug_ros.c:5
#define NULL
Definition: types.h:112
#define FALSE
Definition: types.h:117
const GLubyte * c
Definition: glext.h:8905
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
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 GLint GLint j
Definition: glfuncs.h:250
#define c
Definition: ke_i.h:80
@ NOTIFY_DEVICEID4_DELETE
@ NOTIFY_DEVICEID4_CHANGE
#define CB_COMPOUND_MAX_OPERATIONS
#define calloc
Definition: rosglue.h:14
enum xdr_op x_op
Definition: xdr.h:104
enum notify_deviceid_type4 type
@ XDR_DECODE
Definition: xdr.h:86
@ XDR_FREE
Definition: xdr.h:87
bool_t(* xdrproc_t)(XDR *,...)
Definition: xdr.h:144
bool_t xdr_array(XDR *xdrs, caddr_t *addrp, u_int *sizep, u_int maxsize, u_int elsize, xdrproc_t elproc)
Definition: xdr_array.c:61

◆ op_cb_notify_deviceid_res()

static bool_t op_cb_notify_deviceid_res ( XDR xdr,
struct cb_notify_deviceid_res res 
)
static

Definition at line 545 of file callback_xdr.c.

546{
548
549 result = xdr_enum(xdr, &res->status);
550 if (!result) { CBX_ERR("notify_deviceid.status"); goto out; }
551out:
552 return result;
553}

◆ op_cb_notify_lock_args()

static bool_t op_cb_notify_lock_args ( XDR xdr,
struct cb_notify_lock_args res 
)
static

Definition at line 440 of file callback_xdr.c.

441{
443
444 result = xdr_u_int32_t(xdr, &res->target_highest_slotid);
445 if (!result) { CBX_ERR("notify_lock.target_highest_slotid"); goto out; }
446out:
447 return result;
448}

◆ op_cb_notify_lock_res()

static bool_t op_cb_notify_lock_res ( XDR xdr,
struct cb_notify_lock_res res 
)
static

Definition at line 450 of file callback_xdr.c.

451{
453
454 result = xdr_enum(xdr, &res->status);
455 if (!result) { CBX_ERR("notify_lock.status"); goto out; }
456out:
457 return result;
458}

◆ op_cb_notify_res()

static bool_t op_cb_notify_res ( XDR xdr,
struct cb_notify_res res 
)
static

Definition at line 345 of file callback_xdr.c.

346{
348
349 result = xdr_enum(xdr, &res->status);
350 if (!result) { CBX_ERR("notify.status"); goto out; }
351out:
352 return result;
353}

◆ op_cb_push_deleg_args()

static bool_t op_cb_push_deleg_args ( XDR xdr,
struct cb_push_deleg_args res 
)
static

Definition at line 356 of file callback_xdr.c.

357{
359
360 result = xdr_u_int32_t(xdr, &res->target_highest_slotid);
361 if (!result) { CBX_ERR("push_deleg.target_highest_slotid"); goto out; }
362out:
363 return result;
364}

◆ op_cb_push_deleg_res()

static bool_t op_cb_push_deleg_res ( XDR xdr,
struct cb_push_deleg_res res 
)
static

Definition at line 366 of file callback_xdr.c.

367{
369
370 result = xdr_enum(xdr, &res->status);
371 if (!result) { CBX_ERR("push_deleg.status"); goto out; }
372out:
373 return result;
374}

◆ op_cb_recall_any_args()

static bool_t op_cb_recall_any_args ( XDR xdr,
struct cb_recall_any_args res 
)
static

Definition at line 377 of file callback_xdr.c.

378{
380
381 result = xdr_u_int32_t(xdr, &res->target_highest_slotid);
382 if (!result) { CBX_ERR("recall_any.target_highest_slotid"); goto out; }
383out:
384 return result;
385}

◆ op_cb_recall_any_res()

static bool_t op_cb_recall_any_res ( XDR xdr,
struct cb_recall_any_res res 
)
static

Definition at line 387 of file callback_xdr.c.

388{
390
391 result = xdr_enum(xdr, &res->status);
392 if (!result) { CBX_ERR("recall_any.status"); goto out; }
393out:
394 return result;
395}

◆ op_cb_recall_args()

static bool_t op_cb_recall_args ( XDR xdr,
struct cb_recall_args args 
)
static

Definition at line 308 of file callback_xdr.c.

309{
311
312 result = common_stateid(xdr, &args->stateid);
313 if (!result) { CBX_ERR("recall.stateid"); goto out; }
314
315 result = xdr_bool(xdr, &args->truncate);
316 if (!result) { CBX_ERR("recall.truncate"); goto out; }
317
318 result = common_fh(xdr, &args->fh);
319 if (!result) { CBX_ERR("recall.fh"); goto out; }
320out:
321 return result;
322}

◆ op_cb_recall_res()

static bool_t op_cb_recall_res ( XDR xdr,
struct cb_recall_res res 
)
static

Definition at line 324 of file callback_xdr.c.

325{
327
328 result = xdr_enum(xdr, &res->status);
329 if (!result) { CBX_ERR("recall.status"); goto out; }
330out:
331 return result;
332}

◆ op_cb_recall_slot_args()

static bool_t op_cb_recall_slot_args ( XDR xdr,
struct cb_recall_slot_args res 
)
static

Definition at line 133 of file callback_xdr.c.

134{
136
137 result = xdr_u_int32_t(xdr, &res->target_highest_slotid);
138 if (!result) { CBX_ERR("recall_slot.target_highest_slotid"); goto out; }
139out:
140 return result;
141}

◆ op_cb_recall_slot_res()

static bool_t op_cb_recall_slot_res ( XDR xdr,
struct cb_recall_slot_res res 
)
static

Definition at line 143 of file callback_xdr.c.

144{
146
147 result = xdr_enum(xdr, &res->status);
148 if (!result) { CBX_ERR("recall_slot.status"); goto out; }
149out:
150 return result;
151}

◆ op_cb_recallable_obj_avail_args()

static bool_t op_cb_recallable_obj_avail_args ( XDR xdr,
struct cb_recallable_obj_avail_args res 
)
static

Definition at line 398 of file callback_xdr.c.

399{
401
402 result = xdr_u_int32_t(xdr, &res->target_highest_slotid);
403 if (!result) { CBX_ERR("recallable_obj_avail.target_highest_slotid"); goto out; }
404out:
405 return result;
406}

◆ op_cb_recallable_obj_avail_res()

static bool_t op_cb_recallable_obj_avail_res ( XDR xdr,
struct cb_recallable_obj_avail_res res 
)
static

Definition at line 408 of file callback_xdr.c.

409{
411
412 result = xdr_enum(xdr, &res->status);
413 if (!result) { CBX_ERR("recallable_obj_avail.status"); goto out; }
414out:
415 return result;
416}

◆ op_cb_sequence_args()

static bool_t op_cb_sequence_args ( XDR xdr,
struct cb_sequence_args args 
)
static

Definition at line 182 of file callback_xdr.c.

183{
185
186 result = xdr_opaque(xdr, args->sessionid, NFS4_SESSIONID_SIZE);
187 if (!result) { CBX_ERR("sequence_args.sessionid"); goto out; }
188
189 result = xdr_u_int32_t(xdr, &args->sequenceid);
190 if (!result) { CBX_ERR("sequence_args.sequenceid"); goto out; }
191
192 result = xdr_u_int32_t(xdr, &args->slotid);
193 if (!result) { CBX_ERR("sequence_args.slotid"); goto out; }
194
195 result = xdr_u_int32_t(xdr, &args->highest_slotid);
196 if (!result) { CBX_ERR("sequence_args.highest_slotid"); goto out; }
197
198 result = xdr_bool(xdr, &args->cachethis);
199 if (!result) { CBX_ERR("sequence_args.cachethis"); goto out; }
200
201 result = xdr_array(xdr, (char**)&args->ref_lists,
202 &args->ref_list_count, 64, sizeof(struct cb_sequence_ref_list),
204 if (!result) { CBX_ERR("sequence_args.ref_lists"); goto out; }
205out:
206 return result;
207}
static bool_t op_cb_sequence_ref_list(XDR *xdr, struct cb_sequence_ref_list *args)
Definition: callback_xdr.c:168
#define NFS4_SESSIONID_SIZE
Definition: nfs41_const.h:32

◆ op_cb_sequence_ref()

static bool_t op_cb_sequence_ref ( XDR xdr,
struct cb_sequence_ref args 
)
static

Definition at line 155 of file callback_xdr.c.

156{
158
159 result = xdr_u_int32_t(xdr, &args->sequenceid);
160 if (!result) { CBX_ERR("sequence_ref.sequenceid"); goto out; }
161
162 result = xdr_u_int32_t(xdr, &args->slotid);
163 if (!result) { CBX_ERR("sequence_ref.slotid"); goto out; }
164out:
165 return result;
166}

Referenced by op_cb_sequence_ref_list().

◆ op_cb_sequence_ref_list()

static bool_t op_cb_sequence_ref_list ( XDR xdr,
struct cb_sequence_ref_list args 
)
static

Definition at line 168 of file callback_xdr.c.

169{
171
172 result = xdr_opaque(xdr, args->sessionid, NFS4_SESSIONID_SIZE);
173 if (!result) { CBX_ERR("sequence_ref_list.sessionid"); goto out; }
174
175 result = xdr_array(xdr, (char**)&args->calls, &args->call_count,
176 64, sizeof(struct cb_sequence_ref), (xdrproc_t)op_cb_sequence_ref);
177 if (!result) { CBX_ERR("sequence_ref_list.calls"); goto out; }
178out:
179 return result;
180}
static bool_t op_cb_sequence_ref(XDR *xdr, struct cb_sequence_ref *args)
Definition: callback_xdr.c:155

Referenced by op_cb_sequence_args().

◆ op_cb_sequence_res()

static bool_t op_cb_sequence_res ( XDR xdr,
struct cb_sequence_res res 
)
static

Definition at line 236 of file callback_xdr.c.

237{
239
240 result = xdr_union(xdr, &res->status, (char*)&res->ok,
242 if (!result) { CBX_ERR("seq:argop.args"); goto out; }
243out:
244 return result;
245}
bool_t xdr_void(void)
Definition: xdr.c:92
static const struct xdr_discrim cb_sequence_res_discrim[]
Definition: callback_xdr.c:231

◆ op_cb_sequence_res_ok()

static bool_t op_cb_sequence_res_ok ( XDR xdr,
struct cb_sequence_res_ok res 
)
static

Definition at line 209 of file callback_xdr.c.

210{
212
213 result = xdr_opaque(xdr, res->sessionid, NFS4_SESSIONID_SIZE);
214 if (!result) { CBX_ERR("sequence_res.sessionid"); goto out; }
215
216 result = xdr_u_int32_t(xdr, &res->sequenceid);
217 if (!result) { CBX_ERR("sequence_res.sequenceid"); goto out; }
218
219 result = xdr_u_int32_t(xdr, &res->slotid);
220 if (!result) { CBX_ERR("sequence_res.slotid"); goto out; }
221
222 result = xdr_u_int32_t(xdr, &res->highest_slotid);
223 if (!result) { CBX_ERR("sequence_res.highest_slotid"); goto out; }
224
225 result = xdr_u_int32_t(xdr, &res->target_highest_slotid);
226 if (!result) { CBX_ERR("sequence_res.target_highest_slotid"); goto out; }
227out:
228 return result;
229}

◆ op_cb_wants_cancelled_args()

static bool_t op_cb_wants_cancelled_args ( XDR xdr,
struct cb_wants_cancelled_args res 
)
static

Definition at line 419 of file callback_xdr.c.

420{
422
423 result = xdr_u_int32_t(xdr, &res->target_highest_slotid);
424 if (!result) { CBX_ERR("wants_cancelled.target_highest_slotid"); goto out; }
425out:
426 return result;
427}

◆ op_cb_wants_cancelled_res()

static bool_t op_cb_wants_cancelled_res ( XDR xdr,
struct cb_wants_cancelled_res res 
)
static

Definition at line 429 of file callback_xdr.c.

430{
432
433 result = xdr_enum(xdr, &res->status);
434 if (!result) { CBX_ERR("wants_cancelled.status"); goto out; }
435out:
436 return result;
437}

◆ proc_cb_compound_args()

bool_t proc_cb_compound_args ( XDR xdr,
struct cb_compound_args args 
)

Definition at line 590 of file callback_xdr.c.

591{
593
594 result = cb_compound_tag(xdr, &args->tag);
595 if (!result) { CBX_ERR("compound.tag"); goto out; }
596
597 result = xdr_u_int32_t(xdr, &args->minorversion);
598 if (!result) { CBX_ERR("compound.minorversion"); goto out; }
599
600 /* "superfluous in NFSv4.1 and MUST be ignored by the client" */
601 result = xdr_u_int32_t(xdr, &args->callback_ident);
602 if (!result) { CBX_ERR("compound.callback_ident"); goto out; }
603
604 result = xdr_array(xdr, (char**)&args->argarray,
605 &args->argarray_count, CB_COMPOUND_MAX_OPERATIONS,
606 sizeof(struct cb_argop), (xdrproc_t)cb_compound_argop);
607 if (!result) { CBX_ERR("compound.argarray"); goto out; }
608out:
609 return result;
610}
static bool_t cb_compound_argop(XDR *xdr, struct cb_argop *args)
Definition: callback_xdr.c:579

Referenced by handle_cb_compound(), replay_cache_write(), and replay_validate_args().

◆ proc_cb_compound_res()

bool_t proc_cb_compound_res ( XDR xdr,
struct cb_compound_res res 
)

Definition at line 638 of file callback_xdr.c.

639{
641
642 if (res == NULL)
643 return TRUE;
644
645 result = xdr_enum(xdr, &res->status);
646 if (!result) { CBX_ERR("compound_res.status"); goto out; }
647
648 result = cb_compound_tag(xdr, &res->tag);
649 if (!result) { CBX_ERR("compound_res.tag"); goto out; }
650
651 result = xdr_array(xdr, (char**)&res->resarray,
652 &res->resarray_count, CB_COMPOUND_MAX_OPERATIONS,
653 sizeof(struct cb_resop), (xdrproc_t)cb_compound_resop);
654 if (!result) { CBX_ERR("compound_res.resarray"); goto out; }
655out:
656 if (xdr->x_op == XDR_FREE)
657 free(res);
658 return result;
659}
static bool_t cb_compound_resop(XDR *xdr, struct cb_resop *res)
Definition: callback_xdr.c:628

Referenced by get_client_for_netaddr(), replay_cache_read(), and replay_cache_write().

◆ xdr_bitmap4()

bool_t xdr_bitmap4 ( XDR xdr,
bitmap4 bitmap 
)

Definition at line 48 of file nfs41_xdr.c.

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

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

◆ xdr_fattr4()

bool_t xdr_fattr4 ( XDR xdr,
fattr4 fattr 
)

Definition at line 144 of file nfs41_xdr.c.

147{
148 unsigned char *attr_vals = fattr->attr_vals;
149
150 if (!xdr_bitmap4(xdr, &fattr->attrmask))
151 return FALSE;
152
153 return xdr_bytes(xdr, (char **)&attr_vals, &fattr->attr_vals_len, NFS4_OPAQUE_LIMIT);
154}
bool_t xdr_bitmap4(XDR *xdr, bitmap4 *bitmap)
Definition: nfs41_xdr.c:48

Referenced by decode_op_getattr(), decode_readdir_entry(), encode_createattrs4(), encode_op_setattr(), and op_cb_getattr_res().

Variable Documentation

◆ cb_argop_discrim

const struct xdr_discrim cb_argop_discrim[]
static
Initial value:
= {
}
static bool_t op_cb_wants_cancelled_args(XDR *xdr, struct cb_wants_cancelled_args *res)
Definition: callback_xdr.c:419
static bool_t op_cb_recall_any_args(XDR *xdr, struct cb_recall_any_args *res)
Definition: callback_xdr.c:377
static bool_t op_cb_notify_args(XDR *xdr, struct cb_notify_args *res)
Definition: callback_xdr.c:335
static bool_t op_cb_push_deleg_args(XDR *xdr, struct cb_push_deleg_args *res)
Definition: callback_xdr.c:356
static bool_t op_cb_layoutrecall_args(XDR *xdr, struct cb_layoutrecall_args *args)
Definition: callback_xdr.c:101
static bool_t op_cb_notify_lock_args(XDR *xdr, struct cb_notify_lock_args *res)
Definition: callback_xdr.c:440
static bool_t op_cb_recall_args(XDR *xdr, struct cb_recall_args *args)
Definition: callback_xdr.c:308
static bool_t op_cb_recall_slot_args(XDR *xdr, struct cb_recall_slot_args *res)
Definition: callback_xdr.c:133
static bool_t op_cb_recallable_obj_avail_args(XDR *xdr, struct cb_recallable_obj_avail_args *res)
Definition: callback_xdr.c:398
static bool_t op_cb_sequence_args(XDR *xdr, struct cb_sequence_args *args)
Definition: callback_xdr.c:182
static bool_t op_cb_getattr_args(XDR *xdr, struct cb_getattr_args *args)
Definition: callback_xdr.c:248
static bool_t op_cb_notify_deviceid_args(XDR *xdr, struct cb_notify_deviceid_args *args)
Definition: callback_xdr.c:490
@ OP_CB_SEQUENCE
@ OP_CB_PUSH_DELEG
@ OP_CB_WANTS_CANCELLED
@ OP_CB_LAYOUTRECALL
@ OP_CB_NOTIFY_LOCK
@ OP_CB_ILLEGAL
@ OP_CB_RECALL_ANY
@ OP_CB_GETATTR
@ OP_CB_NOTIFY_DEVICEID
@ OP_CB_RECALL_SLOT
@ OP_CB_NOTIFY
@ OP_CB_RECALL
@ OP_CB_RECALLABLE_OBJ_AVAIL

Definition at line 563 of file callback_xdr.c.

Referenced by cb_compound_argop().

◆ cb_layoutrecall_discrim

const struct xdr_discrim cb_layoutrecall_discrim[]
static
Initial value:
= {
}
static bool_t op_cb_layoutrecall_file(XDR *xdr, struct cb_recall_file *args)
Definition: callback_xdr.c:65
static bool_t op_cb_layoutrecall_fsid(XDR *xdr, union cb_recall_file_args *args)
Definition: callback_xdr.c:84
@ PNFS_RETURN_FSID
Definition: pnfs.h:102
@ PNFS_RETURN_ALL
Definition: pnfs.h:103
@ PNFS_RETURN_FILE
Definition: pnfs.h:101

Definition at line 94 of file callback_xdr.c.

Referenced by op_cb_layoutrecall_args().

◆ cb_resop_discrim

const struct xdr_discrim cb_resop_discrim[]
static
Initial value:
= {
}
static bool_t op_cb_layoutrecall_res(XDR *xdr, struct cb_layoutrecall_res *res)
Definition: callback_xdr.c:121
static bool_t op_cb_sequence_res(XDR *xdr, struct cb_sequence_res *res)
Definition: callback_xdr.c:236
static bool_t op_cb_wants_cancelled_res(XDR *xdr, struct cb_wants_cancelled_res *res)
Definition: callback_xdr.c:429
static bool_t op_cb_notify_res(XDR *xdr, struct cb_notify_res *res)
Definition: callback_xdr.c:345
static bool_t op_cb_recall_res(XDR *xdr, struct cb_recall_res *res)
Definition: callback_xdr.c:324
static bool_t op_cb_getattr_res(XDR *xdr, struct cb_getattr_res *res)
Definition: callback_xdr.c:287
static bool_t op_cb_recall_any_res(XDR *xdr, struct cb_recall_any_res *res)
Definition: callback_xdr.c:387
static bool_t op_cb_recallable_obj_avail_res(XDR *xdr, struct cb_recallable_obj_avail_res *res)
Definition: callback_xdr.c:408
static bool_t op_cb_notify_deviceid_res(XDR *xdr, struct cb_notify_deviceid_res *res)
Definition: callback_xdr.c:545
static bool_t op_cb_push_deleg_res(XDR *xdr, struct cb_push_deleg_res *res)
Definition: callback_xdr.c:366
static bool_t op_cb_recall_slot_res(XDR *xdr, struct cb_recall_slot_res *res)
Definition: callback_xdr.c:143
static bool_t op_cb_notify_lock_res(XDR *xdr, struct cb_notify_lock_res *res)
Definition: callback_xdr.c:450

Definition at line 612 of file callback_xdr.c.

Referenced by cb_compound_resop().

◆ cb_sequence_res_discrim

const struct xdr_discrim cb_sequence_res_discrim[]
static
Initial value:
= {
}
static bool_t op_cb_sequence_res_ok(XDR *xdr, struct cb_sequence_res_ok *res)
Definition: callback_xdr.c:209

Definition at line 231 of file callback_xdr.c.

Referenced by op_cb_sequence_res().