bool_t xdr_remote_client_cmd_args (XDR *xdrs, remote_client_cmd_args *objp) { register int32_t *buf; if (!xdr_string (xdrs, &objp->cmdstring, MAX_CMD_LEN)) return FALSE; if (!xdr_stringlist (xdrs, &objp->environment_settings)) return FALSE; if (!xdr_string (xdrs, &objp->identstring, MAX_IDENT_LEN)) return FALSE; if (!xdr_int (xdrs, &objp->run_in_background)) return FALSE; if (!xdr_int (xdrs, &objp->run_in_shell)) return FALSE; if (!xdr_Iu32 (xdrs, &objp->timeout)) return FALSE; if (!xdr_bool (xdrs, &objp->fail_on_timeout)) return FALSE; if (!xdr_bool (xdrs, &objp->workqueueID_flag)) return FALSE; if (!xdr_Iu32 (xdrs, &objp->workqueueID)) return FALSE; if (!xdr_Iu32 (xdrs, &objp->actionresultID)) return FALSE; if (!xdr_int (xdrs, &objp->msglevel)) return FALSE; return TRUE; }
/* * Function: xdr_nulltype * * Purpose: XDR function for arbitrary pointer types that are either * NULL or contain data. */ bool_t xdr_nulltype(XDR *xdrs, void **objp, xdrproc_t proc) { bool_t null; switch (xdrs->x_op) { case XDR_DECODE: if (!xdr_bool(xdrs, &null)) return FALSE; if (null) { *objp = NULL; return TRUE; } return (*proc)(xdrs, objp); case XDR_ENCODE: if (*objp == NULL) null = TRUE; else null = FALSE; if (!xdr_bool(xdrs, &null)) return FALSE; if (null == FALSE) return (*proc)(xdrs, objp); return TRUE; case XDR_FREE: if (*objp) return (*proc)(xdrs, objp); return TRUE; } return FALSE; }
bool_t xdr_Create_LinkParms (XDR *xdrs, Create_LinkParms *objp) { #if defined(SOLARIS) && !defined(_LP64) register long *buf; #else register int32_t *buf; #endif if (xdrs->x_op == XDR_ENCODE) { buf = XDR_INLINE (xdrs, 3 * BYTES_PER_XDR_UNIT); if (buf == NULL) { if (!xdr_long (xdrs, &objp->clientId)) return FALSE; if (!xdr_bool (xdrs, &objp->lockDevice)) return FALSE; if (!xdr_u_long (xdrs, &objp->lock_timeout)) return FALSE; } else { IXDR_PUT_INT32(buf, objp->clientId); IXDR_PUT_BOOL(buf, objp->lockDevice); IXDR_PUT_U_INT32(buf, objp->lock_timeout); } if (!xdr_string (xdrs, &objp->device, ~0)) return FALSE; return TRUE; } else if (xdrs->x_op == XDR_DECODE) { buf = XDR_INLINE (xdrs, 3 * BYTES_PER_XDR_UNIT); if (buf == NULL) { if (!xdr_long (xdrs, &objp->clientId)) return FALSE; if (!xdr_bool (xdrs, &objp->lockDevice)) return FALSE; if (!xdr_u_long (xdrs, &objp->lock_timeout)) return FALSE; } else { objp->clientId = IXDR_GET_INT32(buf); objp->lockDevice = IXDR_GET_BOOL(buf); objp->lock_timeout = IXDR_GET_U_INT32(buf); } if (!xdr_string (xdrs, &objp->device, ~0)) return FALSE; return TRUE; } if (!xdr_long (xdrs, &objp->clientId)) return FALSE; if (!xdr_bool (xdrs, &objp->lockDevice)) return FALSE; if (!xdr_u_long (xdrs, &objp->lock_timeout)) return FALSE; if (!xdr_string (xdrs, &objp->device, ~0)) return FALSE; return TRUE; }
bool_t xdr_remote_client_query_tag_outcome (XDR *xdrs, remote_client_query_tag_outcome *objp) { register int32_t *buf; if (xdrs->x_op == XDR_ENCODE) { buf = XDR_INLINE (xdrs, 4 * BYTES_PER_XDR_UNIT); if (buf == NULL) { if (!xdr_bool (xdrs, &objp->valid)) return FALSE; if (!xdr_u_int (xdrs, &objp->state)) return FALSE; if (!xdr_int (xdrs, &objp->cmd_exit_code)) return FALSE; if (!xdr_int (xdrs, &objp->cmd_exit_signal)) return FALSE; } else { IXDR_PUT_BOOL(buf, objp->valid); IXDR_PUT_U_LONG(buf, objp->state); IXDR_PUT_LONG(buf, objp->cmd_exit_code); IXDR_PUT_LONG(buf, objp->cmd_exit_signal); } return TRUE; } else if (xdrs->x_op == XDR_DECODE) { buf = XDR_INLINE (xdrs, 4 * BYTES_PER_XDR_UNIT); if (buf == NULL) { if (!xdr_bool (xdrs, &objp->valid)) return FALSE; if (!xdr_u_int (xdrs, &objp->state)) return FALSE; if (!xdr_int (xdrs, &objp->cmd_exit_code)) return FALSE; if (!xdr_int (xdrs, &objp->cmd_exit_signal)) return FALSE; } else { objp->valid = IXDR_GET_BOOL(buf); objp->state = IXDR_GET_U_LONG(buf); objp->cmd_exit_code = IXDR_GET_LONG(buf); objp->cmd_exit_signal = IXDR_GET_LONG(buf); } return TRUE; } if (!xdr_bool (xdrs, &objp->valid)) return FALSE; if (!xdr_u_int (xdrs, &objp->state)) return FALSE; if (!xdr_int (xdrs, &objp->cmd_exit_code)) return FALSE; if (!xdr_int (xdrs, &objp->cmd_exit_signal)) return FALSE; return TRUE; }
bool_t xdr_klm_holder (XDR *xdrs, klm_holder *objp) { register int32_t *buf; if (xdrs->x_op == XDR_ENCODE) { buf = XDR_INLINE (xdrs, 4 * BYTES_PER_XDR_UNIT); if (buf == NULL) { if (!xdr_bool (xdrs, &objp->exclusive)) return FALSE; if (!xdr_int (xdrs, &objp->svid)) return FALSE; if (!xdr_u_int (xdrs, &objp->l_offset)) return FALSE; if (!xdr_u_int (xdrs, &objp->l_len)) return FALSE; } else { IXDR_PUT_BOOL(buf, objp->exclusive); IXDR_PUT_LONG(buf, objp->svid); IXDR_PUT_U_LONG(buf, objp->l_offset); IXDR_PUT_U_LONG(buf, objp->l_len); } return TRUE; } else if (xdrs->x_op == XDR_DECODE) { buf = XDR_INLINE (xdrs, 4 * BYTES_PER_XDR_UNIT); if (buf == NULL) { if (!xdr_bool (xdrs, &objp->exclusive)) return FALSE; if (!xdr_int (xdrs, &objp->svid)) return FALSE; if (!xdr_u_int (xdrs, &objp->l_offset)) return FALSE; if (!xdr_u_int (xdrs, &objp->l_len)) return FALSE; } else { objp->exclusive = IXDR_GET_BOOL(buf); objp->svid = IXDR_GET_LONG(buf); objp->l_offset = IXDR_GET_U_LONG(buf); objp->l_len = IXDR_GET_U_LONG(buf); } return TRUE; } if (!xdr_bool (xdrs, &objp->exclusive)) return FALSE; if (!xdr_int (xdrs, &objp->svid)) return FALSE; if (!xdr_u_int (xdrs, &objp->l_offset)) return FALSE; if (!xdr_u_int (xdrs, &objp->l_len)) return FALSE; return TRUE; }
bool_t xdr_klm_lockargs(XDR *xdrs, klm_lockargs *objp) { if (!xdr_bool(xdrs, &objp->block)) return (FALSE); if (!xdr_bool(xdrs, &objp->exclusive)) return (FALSE); if (!xdr_klm_lock(xdrs, &objp->alock)) return (FALSE); return (TRUE); }
bool_t xdr_klm_lockargs (XDR *xdrs, klm_lockargs *objp) { register int32_t *buf; if (!xdr_bool (xdrs, &objp->block)) return FALSE; if (!xdr_bool (xdrs, &objp->exclusive)) return FALSE; if (!xdr_klm_lock (xdrs, &objp->alock)) return FALSE; return TRUE; }
bool_t xdr_nlm4_cancargs (XDR *xdrs, nlm4_cancargs *objp) { if (!xdr_netobj (xdrs, &objp->cookie)) return FALSE; if (!xdr_bool (xdrs, &objp->block)) return FALSE; if (!xdr_bool (xdrs, &objp->exclusive)) return FALSE; if (!xdr_nlm4_lock (xdrs, &objp->alock)) return FALSE; return TRUE; }
bool_t xdr_nlm_cancargs(XDR *xdrs, nlm_cancargs *objp) { if (!xdr_netobj(xdrs, &objp->cookie)) return (FALSE); if (!xdr_bool(xdrs, &objp->block)) return (FALSE); if (!xdr_bool(xdrs, &objp->exclusive)) return (FALSE); if (!xdr_nlm_lock(xdrs, &objp->alock)) return (FALSE); return (TRUE); }
void writeInput(void) { const char routineName[] = "writeInput"; bool_t result=TRUE, PRD_angle_dep, XRD, big_endian; FILE *fp_out; XDR xdrs; if (!strcmp(INPUT_DOT_OUT, "none")) return; if ((fp_out = fopen(INPUT_DOT_OUT, "w")) == NULL) { sprintf(messageStr, "Unable to open output file %s", INPUT_DOT_OUT); Error(ERROR_LEVEL_1, routineName, messageStr); return; } xdrstdio_create(&xdrs, fp_out, XDR_ENCODE); PRD_angle_dep = (input.PRD_angle_dep != PRD_ANGLE_INDEP && atmos.NPRDactive > 0); XRD = (input.XRD && atmos.NPRDactive > 0); /* --- Write various input parameters to file -- -------------- */ result &= xdr_bool(&xdrs, &input.magneto_optical); result &= xdr_bool(&xdrs, &PRD_angle_dep); result &= xdr_bool(&xdrs, &XRD); result &= xdr_enum(&xdrs, (enum_t *) &input.startJ); result &= xdr_enum(&xdrs, (enum_t *) &input.StokesMode); result &= xdr_double(&xdrs, &input.metallicity); result &= xdr_bool(&xdrs, &input.backgr_pol); /* --- Write Endianness of compute architecture so that J can be read properly in the analysis -- -------------- */ big_endian = is_big_endian(); result &= xdr_bool(&xdrs, &big_endian); if (!result) { sprintf(messageStr, "Unable to write proper amount to output file %s", INPUT_DOT_OUT); Error(ERROR_LEVEL_1, routineName, messageStr); } xdr_destroy(&xdrs); fclose(fp_out); }
bool_t xdr_remote_client_copyfile_outcome (XDR *xdrs, remote_client_copyfile_outcome *objp) { register int32_t *buf; if (!xdr_bool (xdrs, &objp->valid_copyfile)) return FALSE; if (!xdr_int (xdrs, &objp->num_bytes_in_transfer)) return FALSE; if (!xdr_bytes (xdrs, (char **)&objp->data.data_val, (u_int *) &objp->data.data_len, ~0)) return FALSE; if (!xdr_bool (xdrs, &objp->eof)) return FALSE; return TRUE; }
bool_t xdr_nlm_cancargs (XDR *xdrs, nlm_cancargs *objp) { register int32_t *buf; if (!xdr_netobj (xdrs, &objp->cookie)) return FALSE; if (!xdr_bool (xdrs, &objp->block)) return FALSE; if (!xdr_bool (xdrs, &objp->exclusive)) return FALSE; if (!xdr_nlm_lock (xdrs, &objp->alock)) return FALSE; return TRUE; }
/* * Conditionally decode a RDMA WRITE chunk list from XDR stream. * * If the next boolean in the XDR stream is false there is no * RDMA WRITE chunk list present. Otherwise iterate over the * array and for each entry: allocate a struct clist and decode. * Pass back an indication via wlist_exists if we have seen a * RDMA WRITE chunk list. */ bool_t xdr_decode_wlist(XDR *xdrs, struct clist **w, bool_t *wlist_exists) { struct clist *tmp; bool_t more = FALSE; uint32_t seg_array_len; uint32_t i; if (!xdr_bool(xdrs, &more)) return (FALSE); /* is there a wlist? */ if (more == FALSE) { *wlist_exists = FALSE; return (TRUE); } *wlist_exists = TRUE; if (!xdr_uint32(xdrs, &seg_array_len)) return (FALSE); tmp = *w = clist_alloc(); for (i = 0; i < seg_array_len; i++) { if (!xdr_uint32(xdrs, &tmp->c_dmemhandle.mrc_rmr)) return (FALSE); if (!xdr_uint32(xdrs, &tmp->c_len)) return (FALSE); DTRACE_PROBE1(krpc__i__xdr_decode_wlist_len, uint_t, tmp->c_len); if (!xdr_uint64(xdrs, &tmp->u.c_daddr)) return (FALSE); if (i < seg_array_len - 1) { tmp->c_next = clist_alloc(); tmp = tmp->c_next; } else { tmp->c_next = NULL; } } more = FALSE; if (!xdr_bool(xdrs, &more)) return (FALSE); return (TRUE); }
static int xdr_getquota_rslt(XDR *xdrsp, struct getquota_rslt *gqr) { if (!xdr_int(xdrsp, "astat)) { DEBUG(6,("nfs_quotas: Status bad or zero\n")); return 0; } if (!xdr_int(xdrsp, &gqr->getquota_rslt_u.gqr_rquota.rq_bsize)) { DEBUG(6,("nfs_quotas: Block size bad or zero\n")); return 0; } if (!xdr_bool(xdrsp, &gqr->getquota_rslt_u.gqr_rquota.rq_active)) { DEBUG(6,("nfs_quotas: Active bad or zero\n")); return 0; } if (!xdr_int(xdrsp, &gqr->getquota_rslt_u.gqr_rquota.rq_bhardlimit)) { DEBUG(6,("nfs_quotas: Hardlimit bad or zero\n")); return 0; } if (!xdr_int(xdrsp, &gqr->getquota_rslt_u.gqr_rquota.rq_bsoftlimit)) { DEBUG(6,("nfs_quotas: Softlimit bad or zero\n")); return 0; } if (!xdr_int(xdrsp, &gqr->getquota_rslt_u.gqr_rquota.rq_curblocks)) { DEBUG(6,("nfs_quotas: Currentblocks bad or zero\n")); return 0; } return (1); }
bool_t xdr_remote_client_query_version_outcome (XDR *xdrs, remote_client_query_version_outcome *objp) { register int32_t *buf; if (!xdr_u_int (xdrs, &objp->agent_major_version)) return FALSE; if (!xdr_u_int (xdrs, &objp->agent_minor_version)) return FALSE; if (!xdr_string (xdrs, &objp->agent_version_string, 128)) return FALSE; if (!xdr_string (xdrs, &objp->agent_build_machine, 128)) return FALSE; if (!xdr_bool (xdrs, &objp->p_osdata_is_valid)) return FALSE; if (!xdr_string (xdrs, &objp->p_name, 128)) return FALSE; if (!xdr_string (xdrs, &objp->p_os_type, 128)) return FALSE; if (!xdr_string (xdrs, &objp->p_os_version, 128)) return FALSE; if (!xdr_string (xdrs, &objp->p_os_description, 128)) return FALSE; if (!xdr_string (xdrs, &objp->p_cpu_architecture, 128)) return FALSE; return TRUE; }
static int my_xdr_getquota_rslt(XDR *xdrsp, struct getquota_rslt *gqr) { int quotastat; if (!xdr_int(xdrsp, "astat)) { DEBUG(6,("nfs_quotas: Status bad or zero\n")); return 0; } gqr->GQR_STATUS = quotastat; if (!xdr_int(xdrsp, &gqr->GQR_RQUOTA.rq_bsize)) { DEBUG(6,("nfs_quotas: Block size bad or zero\n")); return 0; } if (!xdr_bool(xdrsp, &gqr->GQR_RQUOTA.rq_active)) { DEBUG(6,("nfs_quotas: Active bad or zero\n")); return 0; } if (!xdr_int(xdrsp, (int *)&gqr->GQR_RQUOTA.rq_bhardlimit)) { DEBUG(6,("nfs_quotas: Hardlimit bad or zero\n")); return 0; } if (!xdr_int(xdrsp, (int *)&gqr->GQR_RQUOTA.rq_bsoftlimit)) { DEBUG(6,("nfs_quotas: Softlimit bad or zero\n")); return 0; } if (!xdr_int(xdrsp, (int *)&gqr->GQR_RQUOTA.rq_curblocks)) { DEBUG(6,("nfs_quotas: Currentblocks bad or zero\n")); return 0; } return (1); }
/* * XDR decode the long reply write chunk. */ bool_t xdr_decode_reply_wchunk(XDR *xdrs, struct clist **clist) { bool_t have_rchunk = FALSE; struct clist *first = NULL, *ncl = NULL; uint32_t num_wclist; uint32_t i; if (!xdr_bool(xdrs, &have_rchunk)) return (FALSE); if (have_rchunk == FALSE) return (TRUE); if (!xdr_uint32(xdrs, &num_wclist)) { DTRACE_PROBE(krpc__e__xdrrdma__replywchunk__listlength); return (FALSE); } if (num_wclist == 0) { return (FALSE); } first = ncl = clist_alloc(); for (i = 0; i < num_wclist; i++) { if (i > 0) { ncl->c_next = clist_alloc(); ncl = ncl->c_next; } if (!xdr_uint32(xdrs, &ncl->c_dmemhandle.mrc_rmr)) goto err_out; if (!xdr_uint32(xdrs, &ncl->c_len)) goto err_out; if (!xdr_uint64(xdrs, &ncl->u.c_daddr)) goto err_out; if (ncl->c_len > MAX_SVC_XFER_SIZE) { DTRACE_PROBE( krpc__e__xdrrdma__replywchunk__chunklist_toobig); ncl->c_len = MAX_SVC_XFER_SIZE; } if (!(ncl->c_dmemhandle.mrc_rmr && (ncl->c_len > 0) && ncl->u.c_daddr)) DTRACE_PROBE( krpc__e__xdrrdma__replywchunk__invalid_segaddr); DTRACE_PROBE1(krpc__i__xdr_decode_reply_wchunk_c_len, uint32_t, ncl->c_len); } *clist = first; return (TRUE); err_out: clist_free(first); return (FALSE); }
/* * What is going on with linked lists? (!) * First recall the link list declaration from pmap_prot.h: * * struct pmaplist { * struct pmap pml_map; * struct pmaplist *pml_map; * }; * * Compare that declaration with a corresponding xdr declaration that * is (a) pointer-less, and (b) recursive: * * typedef union switch (bool_t) { * * case TRUE: struct { * struct pmap; * pmaplist_t foo; * }; * * case FALSE: struct {}; * } pmaplist_t; * * Notice that the xdr declaration has no nxt pointer while * the C declaration has no bool_t variable. The bool_t can be * interpreted as ``more data follows me''; if FALSE then nothing * follows this bool_t; if TRUE then the bool_t is followed by * an actual struct pmap, and then (recursively) by the * xdr union, pmaplist_t. * * This could be implemented via the xdr_union primitive, though this * would cause a one recursive call per element in the list. Rather than do * that we can ``unwind'' the recursion * into a while loop and do the union arms in-place. * * The head of the list is what the C programmer wishes to past around * the net, yet is the data that the pointer points to which is interesting; * this sounds like a job for xdr_reference! */ bool_t xdr_pmaplist( register XDR *xdrs, register struct pmaplist **rp) { /* * more_elements is pre-computed in case the direction is * XDR_ENCODE or XDR_FREE. more_elements is overwritten by * xdr_bool when the direction is XDR_DECODE. */ bool_t more_elements; register int freeing = (xdrs->x_op == XDR_FREE); register struct pmaplist **next; while (TRUE) { more_elements = (bool_t)(*rp != NULL); if (! xdr_bool(xdrs, &more_elements)) return (FALSE); if (! more_elements) return (TRUE); /* we are done */ /* * the unfortunate side effect of non-recursion is that in * the case of freeing we must remember the next object * before we free the current object ... */ if (freeing) next = &((*rp)->pml_next); if (! xdr_reference(xdrs, (caddr_t *)rp, (u_int)sizeof(struct pmaplist), xdr_pmap)) return (FALSE); rp = (freeing) ? next : &((*rp)->pml_next); } }
static bool_t smb_posix_grps_helper_xdr(XDR *xdrs, char **identity) { uint32_t pos, len; uint32_t cnt; bool_t rc; if (xdrs->x_op == XDR_DECODE) { pos = xdr_getpos(xdrs); if (!xdr_bool(xdrs, &rc)) return (FALSE); if (!xdr_uint32_t(xdrs, &cnt)) return (FALSE); rc = xdr_setpos(xdrs, pos); if (rc == FALSE) return (FALSE); } else { if (*identity == NULL) return (FALSE); cnt = ((smb_posix_grps_t *)(uintptr_t)*identity)->pg_ngrps; } len = SMB_POSIX_GRPS_SIZE(cnt); if (!xdr_pointer(xdrs, identity, len, (xdrproc_t)smb_posix_grps_xdr)) return (FALSE); return (TRUE); }
/* * Serializes/deserializes a stream of struct ypresp_key_val's. This is used * only by the client side of the batch enumerate operation. */ bool xdr_ypall(XDR *xdrs, struct ypall_callback *callback) { bool_t more; struct ypresp_key_val kv; char keybuf[YPMAXRECORD]; char valbuf[YPMAXRECORD]; if (xdrs->x_op == XDR_ENCODE) return (FALSE); if (xdrs->x_op == XDR_FREE) return (TRUE); kv.keydat.dptr = keybuf; kv.valdat.dptr = valbuf; kv.keydat.dsize = YPMAXRECORD; kv.valdat.dsize = YPMAXRECORD; for (;;) { if (!xdr_bool(xdrs, &more)) return (FALSE); if (!more) return (TRUE); if (!xdr_ypresp_key_val(xdrs, &kv)) return (FALSE); if ((*callback->foreach)(kv.status, kv.keydat.dptr, kv.keydat.dsize, kv.valdat.dptr, kv.valdat.dsize, callback->data)) return (TRUE); } }
static bool_t xdr_mntlistencode(XDR *xdrs, HASHSET *mntlist) { HASHSET_ITERATOR iterator = h_iterator(*mntlist); for (;;) { struct mntentry *m = (struct mntentry *)h_next(iterator); bool_t more_data = (m != NULL); if (!xdr_bool(xdrs, &more_data)) { if (iterator != NULL) free(iterator); return (FALSE); } if (!more_data) break; if ((!xdr_name(xdrs, &m->m_host)) || (!xdr_dirpath(xdrs, &m->m_path))) { if (iterator != NULL) free(iterator); return (FALSE); } } if (iterator != NULL) free(iterator); return (TRUE); }
/* * Serializes/deserializes a ypmaplist. */ static bool xdr_ypmaplist(XDR *xdrs, struct ypmaplist **lst) { bool_t more_elements; int freeing = (xdrs->x_op == XDR_FREE); struct ypmaplist **next; for (;;) { more_elements = (*lst != NULL); if (!xdr_bool(xdrs, &more_elements)) return (FALSE); if (!more_elements) return (TRUE); /* All done */ if (freeing) next = &((*lst)->ypml_next); if (!xdr_reference(xdrs, (caddr_t *)lst, (uint_t)sizeof (struct ypmaplist), (xdrproc_t)xdr_ypmaplist_wrap_string)) return (FALSE); lst = (freeing) ? next : &((*lst)->ypml_next); } /*NOTREACHED*/ }
bool_t xdr_gss_OID(XDR *xdrs, gss_OID *oidp) { gss_OID oid; bool_t is_null; switch (xdrs->x_op) { case XDR_ENCODE: oid = *oidp; if (oid) { is_null = FALSE; if (!xdr_bool(xdrs, &is_null) || !xdr_gss_OID_desc(xdrs, oid)) return (FALSE); } else { is_null = TRUE; if (!xdr_bool(xdrs, &is_null)) return (FALSE); } break; case XDR_DECODE: if (!xdr_bool(xdrs, &is_null)) return (FALSE); if (is_null) { *oidp = GSS_C_NO_OID; } else { oid = mem_alloc(sizeof(gss_OID_desc)); memset(oid, 0, sizeof(*oid)); if (!xdr_gss_OID_desc(xdrs, oid)) { mem_free(oid, sizeof(gss_OID_desc)); return (FALSE); } *oidp = oid; } break; case XDR_FREE: oid = *oidp; if (oid) { xdr_gss_OID_desc(xdrs, oid); mem_free(oid, sizeof(gss_OID_desc)); } } return (TRUE); }
bool_t xdr_gss_OID_set(XDR *xdrs, gss_OID_set *setp) { gss_OID_set set; bool_t is_null; switch (xdrs->x_op) { case XDR_ENCODE: set = *setp; if (set) { is_null = FALSE; if (!xdr_bool(xdrs, &is_null) || !xdr_gss_OID_set_desc(xdrs, set)) return (FALSE); } else { is_null = TRUE; if (!xdr_bool(xdrs, &is_null)) return (FALSE); } break; case XDR_DECODE: if (!xdr_bool(xdrs, &is_null)) return (FALSE); if (is_null) { *setp = GSS_C_NO_OID_SET; } else { set = mem_alloc(sizeof(gss_OID_set_desc)); memset(set, 0, sizeof(*set)); if (!xdr_gss_OID_set_desc(xdrs, set)) { mem_free(set, sizeof(gss_OID_set_desc)); return (FALSE); } *setp = set; } break; case XDR_FREE: set = *setp; if (set) { xdr_gss_OID_set_desc(xdrs, set); mem_free(set, sizeof(gss_OID_set_desc)); } } return (TRUE); }
/* ARGSUSED */ bool_t xdr_encode_rlist_svc(XDR *xdrs, clist *rlist) { bool_t vfalse = FALSE; ASSERT(rlist == NULL); return (xdr_bool(xdrs, &vfalse)); }
bool_t xdr_nlm4_lockargs (XDR *xdrs, nlm4_lockargs *objp) { if (!xdr_netobj (xdrs, &objp->cookie)) return FALSE; if (!xdr_bool (xdrs, &objp->block)) return FALSE; if (!xdr_bool (xdrs, &objp->exclusive)) return FALSE; if (!xdr_nlm4_lock (xdrs, &objp->alock)) return FALSE; if (!xdr_bool (xdrs, &objp->reclaim)) return FALSE; if (!xdr_int (xdrs, &objp->state)) return FALSE; return TRUE; }
void F77_FUNC(xdrfbool,XDRFBOOL)(int *xdrid, int *pb, int *ret) { xdr_fortran_lock(); *ret = xdr_bool(xdridptr[*xdrid], pb); cnt += XDR_INT_SIZE; xdr_fortran_unlock(); }
/* * Serializes a stream of struct ypresp_key_val's. This is used * only by the ypserv side of the transaction. */ static bool xdrypserv_ypall(XDR *xdrs, struct ypreq_nokey *req) { bool_t more = TRUE; struct ypresp_key_val resp; DBM *fdb; resp.keydat.dptr = resp.valdat.dptr = (char *)NULL; resp.keydat.dsize = resp.valdat.dsize = 0; if ((fdb = ypset_current_map(req->map, req->domain, &resp.status)) != NULL) { ypfilter(fdb, (datum *) NULL, &resp.keydat, &resp.valdat, &resp.status, FALSE); while (resp.status == YP_TRUE) { if (!xdr_bool(xdrs, &more)) { return (FALSE); } if (!xdr_ypresp_key_val(xdrs, &resp)) { return (FALSE); } ypfilter(fdb, &resp.keydat, &resp.keydat, &resp.valdat, &resp.status, FALSE); } } if (!xdr_bool(xdrs, &more)) { return (FALSE); } if (!xdr_ypresp_key_val(xdrs, &resp)) { return (FALSE); } more = FALSE; if (!xdr_bool(xdrs, &more)) { return (FALSE); } return (TRUE); }
bool_t xdr_primo_out (XDR *xdrs, primo_out *objp) { register int32_t *buf; if (!xdr_bool (xdrs, &objp->res)) return FALSE; return TRUE; }
bool_t xdr_dirlistp3 (XDR *xdrs, dirlistp3 *objp) { if (!xdr_pointer (xdrs, (char **)&objp->entries, sizeof (entryp3), (xdrproc_t) xdr_entryp3)) return FALSE; if (!xdr_bool (xdrs, &objp->eof)) return FALSE; return TRUE; }