Lines Matching refs:cu

129   struct cu_data *cu = NULL;  in __libc_clntudp_bufcreate()  local
135 cu = (struct cu_data *) mem_alloc (sizeof (*cu) + sendsz + recvsz); in __libc_clntudp_bufcreate()
136 if (cl == NULL || cu == NULL) in __libc_clntudp_bufcreate()
145 cu->cu_outbuf = &cu->cu_inbuf[recvsz]; in __libc_clntudp_bufcreate()
158 cl->cl_private = (caddr_t) cu; in __libc_clntudp_bufcreate()
159 cu->cu_raddr = *raddr; in __libc_clntudp_bufcreate()
160 cu->cu_rlen = sizeof (cu->cu_raddr); in __libc_clntudp_bufcreate()
161 cu->cu_wait = wait; in __libc_clntudp_bufcreate()
162 cu->cu_total.tv_sec = -1; in __libc_clntudp_bufcreate()
163 cu->cu_total.tv_usec = -1; in __libc_clntudp_bufcreate()
164 cu->cu_sendsz = sendsz; in __libc_clntudp_bufcreate()
165 cu->cu_recvsz = recvsz; in __libc_clntudp_bufcreate()
171 xdrmem_create (&(cu->cu_outxdrs), cu->cu_outbuf, sendsz, XDR_ENCODE); in __libc_clntudp_bufcreate()
172 if (!xdr_callhdr (&(cu->cu_outxdrs), &call_msg)) in __libc_clntudp_bufcreate()
176 cu->cu_xdrpos = XDR_GETPOS (&(cu->cu_outxdrs)); in __libc_clntudp_bufcreate()
195 cu->cu_closeit = TRUE; in __libc_clntudp_bufcreate()
199 cu->cu_closeit = FALSE; in __libc_clntudp_bufcreate()
201 cu->cu_sock = *sockp; in __libc_clntudp_bufcreate()
205 if (cu) in __libc_clntudp_bufcreate()
206 mem_free ((caddr_t) cu, sizeof (*cu) + sendsz + recvsz); in __libc_clntudp_bufcreate()
280 struct cu_data *cu = (struct cu_data *) cl->cl_private; in clntudp_call() local
313 if (cu->cu_total.tv_usec == -1) in clntudp_call()
318 tv = cu->cu_total; in clntudp_call()
320 return (cu->cu_error.re_status = RPC_TIMEDOUT); in clntudp_call()
325 if (!__is_timeval_valid_timeout (cu->cu_wait)) in clntudp_call()
326 return (cu->cu_error.re_status = RPC_TIMEDOUT); in clntudp_call()
329 xdrs = &(cu->cu_outxdrs); in clntudp_call()
333 XDR_SETPOS (xdrs, cu->cu_xdrpos); in clntudp_call()
337 (*(uint32_t *) (cu->cu_outbuf))++; in clntudp_call()
341 return (cu->cu_error.re_status = RPC_CANTENCODEARGS); in clntudp_call()
345 if (__sendto (cu->cu_sock, cu->cu_outbuf, outlen, 0, in clntudp_call()
346 (struct sockaddr *) &(cu->cu_raddr), cu->cu_rlen) in clntudp_call()
349 cu->cu_error.re_errno = errno; in clntudp_call()
350 return (cu->cu_error.re_status = RPC_CANTSEND); in clntudp_call()
356 response_deadline = __deadline_from_timeval (current_time, cu->cu_wait); in clntudp_call()
361 fd.fd = cu->cu_sock; in clntudp_call()
374 return (cu->cu_error.re_status = RPC_TIMEDOUT); in clntudp_call()
390 return (cu->cu_error.re_status = RPC_CANTSEND); in clntudp_call()
399 anyup = is_network_up (cu->cu_sock); in clntudp_call()
401 return (cu->cu_error.re_status = RPC_CANTRECV); in clntudp_call()
407 cu->cu_error.re_errno = errno; in clntudp_call()
408 return (cu->cu_error.re_status = RPC_CANTRECV); in clntudp_call()
423 cu->cu_error.re_errno = errno; in clntudp_call()
424 return (cu->cu_error.re_status = RPC_CANTRECV); in clntudp_call()
436 ret = __recvmsg (cu->cu_sock, &msg, MSG_ERRQUEUE); in clntudp_call()
438 && memcmp (cbuf + 256, cu->cu_outbuf, ret) == 0 in clntudp_call()
444 && memcmp (&err_addr.sin_addr, &cu->cu_raddr.sin_addr, in clntudp_call()
446 && err_addr.sin_port == cu->cu_raddr.sin_port))) in clntudp_call()
452 cu->cu_error.re_errno = e->ee_errno; in clntudp_call()
454 return (cu->cu_error.re_status = RPC_CANTRECV); in clntudp_call()
462 inlen = __recvfrom (cu->cu_sock, cu->cu_inbuf, in clntudp_call()
463 (int) cu->cu_recvsz, MSG_DONTWAIT, in clntudp_call()
471 cu->cu_error.re_errno = errno; in clntudp_call()
472 return (cu->cu_error.re_status = RPC_CANTRECV); in clntudp_call()
478 || memcmp (cu->cu_inbuf, cu->cu_outbuf, in clntudp_call()
491 xdrmem_create (&reply_xdrs, cu->cu_inbuf, (u_int) inlen, XDR_DECODE); in clntudp_call()
496 _seterr_reply (&reply_msg, &(cu->cu_error)); in clntudp_call()
497 if (cu->cu_error.re_status == RPC_SUCCESS) in clntudp_call()
502 cu->cu_error.re_status = RPC_AUTHERROR; in clntudp_call()
503 cu->cu_error.re_why = AUTH_INVALIDRESP; in clntudp_call()
523 cu->cu_error.re_status = RPC_CANTDECODERES; in clntudp_call()
525 return cu->cu_error.re_status; in clntudp_call()
531 struct cu_data *cu = (struct cu_data *) cl->cl_private; in clntudp_geterr() local
533 *errp = cu->cu_error; in clntudp_geterr()
540 struct cu_data *cu = (struct cu_data *) cl->cl_private; in clntudp_freeres() local
541 XDR *xdrs = &(cu->cu_outxdrs); in clntudp_freeres()
555 struct cu_data *cu = (struct cu_data *) cl->cl_private; in clntudp_control() local
562 cu->cu_closeit = TRUE; in clntudp_control()
565 cu->cu_closeit = FALSE; in clntudp_control()
568 cu->cu_total = *(struct timeval *) info; in clntudp_control()
571 *(struct timeval *) info = cu->cu_total; in clntudp_control()
574 cu->cu_wait = *(struct timeval *) info; in clntudp_control()
577 *(struct timeval *) info = cu->cu_wait; in clntudp_control()
580 *(struct sockaddr_in *) info = cu->cu_raddr; in clntudp_control()
583 *(int *)info = cu->cu_sock; in clntudp_control()
591 memcpy (&ui32, cu->cu_outbuf, sizeof (ui32)); in clntudp_control()
599 memcpy (cu->cu_outbuf, &ui32, sizeof (ui32)); in clntudp_control()
609 memcpy (&ui32, cu->cu_outbuf + 4 * BYTES_PER_XDR_UNIT, sizeof (ui32)); in clntudp_control()
616 memcpy (cu->cu_outbuf + 4 * BYTES_PER_XDR_UNIT, &ui32, sizeof (ui32)); in clntudp_control()
625 memcpy (&ui32, cu->cu_outbuf + 3 * BYTES_PER_XDR_UNIT, sizeof (ui32)); in clntudp_control()
632 memcpy (cu->cu_outbuf + 3 * BYTES_PER_XDR_UNIT, &ui32, sizeof (ui32)); in clntudp_control()
648 struct cu_data *cu = (struct cu_data *) cl->cl_private; in clntudp_destroy() local
650 if (cu->cu_closeit) in clntudp_destroy()
652 (void) __close (cu->cu_sock); in clntudp_destroy()
654 XDR_DESTROY (&(cu->cu_outxdrs)); in clntudp_destroy()
655 mem_free ((caddr_t) cu, (sizeof (*cu) + cu->cu_sendsz + cu->cu_recvsz)); in clntudp_destroy()