Lines Matching refs:ct

116   struct ct_data *ct;  in clnttcp_create()  local
120 ct = (struct ct_data *) mem_alloc (sizeof (*ct)); in clnttcp_create()
121 if (h == NULL || ct == NULL) in clnttcp_create()
138 mem_free ((caddr_t) ct, sizeof (struct ct_data)); in clnttcp_create()
163 ct->ct_closeit = TRUE; in clnttcp_create()
167 ct->ct_closeit = FALSE; in clnttcp_create()
173 ct->ct_sock = *sockp; in clnttcp_create()
174 ct->ct_wait.tv_usec = 0; in clnttcp_create()
175 ct->ct_waitset = FALSE; in clnttcp_create()
176 ct->ct_addr = *raddr; in clnttcp_create()
190 xdrmem_create (&(ct->ct_xdrs), ct->ct_mcall, MCALL_MSG_SIZE, XDR_ENCODE); in clnttcp_create()
191 if (!xdr_callhdr (&(ct->ct_xdrs), &call_msg)) in clnttcp_create()
193 if (ct->ct_closeit) in clnttcp_create()
199 ct->ct_mpos = XDR_GETPOS (&(ct->ct_xdrs)); in clnttcp_create()
200 XDR_DESTROY (&(ct->ct_xdrs)); in clnttcp_create()
206 xdrrec_create (&(ct->ct_xdrs), sendsz, recvsz, in clnttcp_create()
207 (caddr_t) ct, readtcp, writetcp); in clnttcp_create()
209 h->cl_private = (caddr_t) ct; in clnttcp_create()
217 mem_free ((caddr_t) ct, sizeof (struct ct_data)); in clnttcp_create()
232 struct ct_data *ct = (struct ct_data *) h->cl_private; in libc_hidden_def() local
233 XDR *xdrs = &(ct->ct_xdrs); in libc_hidden_def()
236 uint32_t *msg_x_id = (uint32_t *) (ct->ct_mcall); /* yuk */ in libc_hidden_def()
240 if (!ct->ct_waitset) in libc_hidden_def()
242 ct->ct_wait = timeout; in libc_hidden_def()
246 (xdr_results == (xdrproc_t) 0 && ct->ct_wait.tv_sec == 0 in libc_hidden_def()
247 && ct->ct_wait.tv_usec == 0) ? FALSE : TRUE; in libc_hidden_def()
251 ct->ct_error.re_status = RPC_SUCCESS; in libc_hidden_def()
253 if ((!XDR_PUTBYTES (xdrs, ct->ct_mcall, ct->ct_mpos)) || in libc_hidden_def()
258 if (ct->ct_error.re_status == RPC_SUCCESS) in libc_hidden_def()
259 ct->ct_error.re_status = RPC_CANTENCODEARGS; in libc_hidden_def()
261 return (ct->ct_error.re_status); in libc_hidden_def()
264 return ct->ct_error.re_status = RPC_CANTSEND; in libc_hidden_def()
270 if (ct->ct_wait.tv_sec == 0 && ct->ct_wait.tv_usec == 0) in libc_hidden_def()
272 return ct->ct_error.re_status = RPC_TIMEDOUT; in libc_hidden_def()
286 return (ct->ct_error.re_status); in libc_hidden_def()
290 if (ct->ct_error.re_status == RPC_SUCCESS) in libc_hidden_def()
292 return ct->ct_error.re_status; in libc_hidden_def()
301 _seterr_reply (&reply_msg, &(ct->ct_error)); in libc_hidden_def()
302 if (ct->ct_error.re_status == RPC_SUCCESS) in libc_hidden_def()
306 ct->ct_error.re_status = RPC_AUTHERROR; in libc_hidden_def()
307 ct->ct_error.re_why = AUTH_INVALIDRESP; in libc_hidden_def()
311 if (ct->ct_error.re_status == RPC_SUCCESS) in libc_hidden_def()
312 ct->ct_error.re_status = RPC_CANTDECODERES; in libc_hidden_def()
327 return ct->ct_error.re_status; in libc_hidden_def()
333 struct ct_data *ct = in clnttcp_geterr() local
336 *errp = ct->ct_error; in clnttcp_geterr()
342 struct ct_data *ct = (struct ct_data *) cl->cl_private; in clnttcp_freeres() local
343 XDR *xdrs = &(ct->ct_xdrs); in clnttcp_freeres()
357 struct ct_data *ct = (struct ct_data *) cl->cl_private; in clnttcp_control() local
365 ct->ct_closeit = TRUE; in clnttcp_control()
368 ct->ct_closeit = FALSE; in clnttcp_control()
371 ct->ct_wait = *(struct timeval *) info; in clnttcp_control()
372 ct->ct_waitset = TRUE; in clnttcp_control()
375 *(struct timeval *) info = ct->ct_wait; in clnttcp_control()
378 *(struct sockaddr_in *) info = ct->ct_addr; in clnttcp_control()
381 *(int *)info = ct->ct_sock; in clnttcp_control()
389 memcpy (&ui32, ct->ct_mcall, sizeof (ui32)); in clnttcp_control()
397 memcpy (ct->ct_mcall, &ui32, sizeof (ui32)); in clnttcp_control()
407 memcpy (&ui32, ct->ct_mcall + 4 * BYTES_PER_XDR_UNIT, sizeof (ui32)); in clnttcp_control()
414 memcpy (ct->ct_mcall + 4 * BYTES_PER_XDR_UNIT, &ui32, sizeof (ui32)); in clnttcp_control()
423 memcpy (&ui32, ct->ct_mcall + 3 * BYTES_PER_XDR_UNIT, sizeof (ui32)); in clnttcp_control()
430 memcpy (ct->ct_mcall + 3 * BYTES_PER_XDR_UNIT, &ui32, sizeof (ui32)); in clnttcp_control()
449 struct ct_data *ct = in clnttcp_destroy() local
452 if (ct->ct_closeit) in clnttcp_destroy()
454 (void) __close (ct->ct_sock); in clnttcp_destroy()
456 XDR_DESTROY (&(ct->ct_xdrs)); in clnttcp_destroy()
457 mem_free ((caddr_t) ct, sizeof (struct ct_data)); in clnttcp_destroy()
469 struct ct_data *ct = (struct ct_data *)ctptr; in readtcp() local
471 int milliseconds = (ct->ct_wait.tv_sec * 1000) + in readtcp()
472 (ct->ct_wait.tv_usec / 1000); in readtcp()
477 fd.fd = ct->ct_sock; in readtcp()
484 ct->ct_error.re_status = RPC_TIMEDOUT; in readtcp()
490 ct->ct_error.re_status = RPC_CANTRECV; in readtcp()
491 ct->ct_error.re_errno = errno; in readtcp()
496 switch (len = __read (ct->ct_sock, buf, len)) in readtcp()
501 ct->ct_error.re_errno = ECONNRESET; in readtcp()
502 ct->ct_error.re_status = RPC_CANTRECV; in readtcp()
507 ct->ct_error.re_errno = errno; in readtcp()
508 ct->ct_error.re_status = RPC_CANTRECV; in readtcp()
518 struct ct_data *ct = (struct ct_data*)ctptr; in writetcp() local
522 if ((i = __write (ct->ct_sock, buf, cnt)) == -1) in writetcp()
524 ct->ct_error.re_errno = errno; in writetcp()
525 ct->ct_error.re_status = RPC_CANTSEND; in writetcp()