Lines Matching refs:ct
124 struct ct_data *ct;
139 ct = (struct ct_data *)bkmem_alloc(sizeof (*ct));
140 if (ct == NULL) {
217 ct->ct_closeit = TRUE;
219 ct->ct_closeit = FALSE;
224 ct->ct_sock = *sockp;
225 ct->ct_wait_msec = 0;
226 ct->ct_total.tv_sec = wait.tv_sec;
227 ct->ct_total.tv_usec = -1;
228 ct->ct_raddr = *raddr;
248 xdrmem_create(&(ct->ct_xdrs), ct->ct_mcall, MCALL_MSG_SIZE,
250 if (! xdr_callhdr(&(ct->ct_xdrs), &call_msg)) {
251 if (ct->ct_closeit)
255 ct->ct_mpos = XDR_GETPOS(&(ct->ct_xdrs));
256 XDR_DESTROY(&(ct->ct_xdrs));
262 xdrrec_create(&(ct->ct_xdrs), sendsz, recvsz, (caddr_t)ct, readtcp,
266 cl->cl_private = (caddr_t)ct;
271 if (ct)
272 bkmem_free((caddr_t)ct, sizeof (*ct));
288 struct ct_data *ct;
297 ct = (struct ct_data *)cl->cl_private;
298 msg_x_id = (uint32_t *)ct->ct_mcall;
300 xdrs = &(ct->ct_xdrs);
302 ct->ct_total = utimeout;
308 if (ct->ct_total.tv_sec == 0)
309 ct->ct_total.tv_sec = RPC_RCVWAIT_MSEC / 1000;
311 ct->ct_wait_msec = ct->ct_total.tv_sec * 1000 +
312 ct->ct_total.tv_usec / 1000;
314 timeout = ct->ct_total;
321 ct->ct_error.re_status = RPC_SUCCESS;
323 if ((! XDR_PUTBYTES(xdrs, ct->ct_mcall, ct->ct_mpos)) ||
328 ct->ct_error.re_status = RPC_CANTENCODEARGS;
330 return (ct->ct_error.re_status);
335 ct->ct_error.re_status = RPC_CANTSEND;
336 return (ct->ct_error.re_status);
343 ct->ct_error.re_status = RPC_TIMEDOUT;
344 return (ct->ct_error.re_status);
355 return (ct->ct_error.re_status);
359 if (ct->ct_error.re_status == RPC_SUCCESS)
361 return (ct->ct_error.re_status);
371 _seterr_reply(&reply_msg, &(ct->ct_error));
372 if (ct->ct_error.re_status == RPC_SUCCESS) {
375 ct->ct_error.re_status = RPC_AUTHERROR;
376 ct->ct_error.re_why = AUTH_INVALIDRESP;
378 if (ct->ct_error.re_status == RPC_SUCCESS) {
379 ct->ct_error.re_status = RPC_CANTDECODERES;
393 return (ct->ct_error.re_status);
402 readtcp(struct ct_data *ct,
418 while ((inlen = recvfrom(ct->ct_sock, buf, len, 0, &from,
421 if (diff > ct->ct_wait_msec) {
433 ct->ct_error.re_errno = ECONNRESET;
434 ct->ct_error.re_status = RPC_CANTRECV;
438 ct->ct_error.re_errno = errno;
439 ct->ct_error.re_status = RPC_CANTRECV;
447 writetcp(ct, buf, len)
448 struct ct_data *ct;
455 if ((i = sendto(ct->ct_sock, (void *)buf, cnt, 0,
456 (struct sockaddr *)&(ct->ct_raddr),
457 sizeof (ct->ct_raddr))) == -1) {
458 ct->ct_error.re_errno = errno;
459 ct->ct_error.re_status = RPC_CANTSEND;
471 struct ct_data *ct = (struct ct_data *)cl->cl_private;
473 *errp = ct->ct_error;
483 struct ct_data *ct = (struct ct_data *)cl->cl_private;
484 XDR *xdrs = &(ct->ct_xdrs);
510 struct ct_data *ct = (struct ct_data *)cl->cl_private;
512 if (ct->ct_closeit) {
513 (void) socket_close(ct->ct_sock);
515 XDR_DESTROY(&(ct->ct_xdrs));
516 bkmem_free((caddr_t)ct, (sizeof (struct ct_data)));