Lines Matching refs:ct
119 register struct ct_data *ct;
131 ct = (struct ct_data *)mem_alloc(sizeof (*ct));
132 if (ct == NULL) {
146 mem_free((caddr_t)ct, sizeof (struct ct_data));
167 ct->ct_closeit = TRUE;
169 ct->ct_closeit = FALSE;
175 ct->ct_sock = *sockp;
176 ct->ct_wait.tv_usec = 0;
177 ct->ct_waitset = FALSE;
178 ct->ct_addr = *raddr;
193 xdrmem_create(&(ct->ct_xdrs), ct->ct_mcall, MCALL_MSG_SIZE,
195 if (! xdr_callhdr(&(ct->ct_xdrs), &call_msg)) {
196 if (ct->ct_closeit) {
201 ct->ct_mpos = XDR_GETPOS(&(ct->ct_xdrs));
202 XDR_DESTROY(&(ct->ct_xdrs));
208 xdrrec_create(&(ct->ct_xdrs), sendsz, recvsz,
209 (caddr_t)ct, readtcp, writetcp);
211 h->cl_private = (caddr_t) ct;
219 mem_free((caddr_t)ct, sizeof (struct ct_data));
234 register struct ct_data *ct = (struct ct_data *) h->cl_private;
235 register XDR *xdrs = &(ct->ct_xdrs);
238 uint32_t *msg_x_id = (uint32_t *)(ct->ct_mcall); /* yuk */
242 if (!ct->ct_waitset) {
243 ct->ct_wait = timeout;
252 ct->ct_error.re_status = RPC_SUCCESS;
254 if ((! XDR_PUTBYTES(xdrs, ct->ct_mcall, ct->ct_mpos)) ||
258 if (ct->ct_error.re_status == RPC_SUCCESS)
259 ct->ct_error.re_status = RPC_CANTENCODEARGS;
261 return (ct->ct_error.re_status);
264 return (ct->ct_error.re_status = RPC_CANTSEND);
271 return (ct->ct_error.re_status = RPC_TIMEDOUT);
284 return (ct->ct_error.re_status);
287 if (ct->ct_error.re_status == RPC_SUCCESS)
289 return (ct->ct_error.re_status);
298 __seterr_reply(&reply_msg, &(ct->ct_error));
299 if (ct->ct_error.re_status == RPC_SUCCESS) {
302 ct->ct_error.re_status = RPC_AUTHERROR;
303 ct->ct_error.re_why = AUTH_INVALIDRESP;
305 if (ct->ct_error.re_status == RPC_SUCCESS)
306 ct->ct_error.re_status = RPC_CANTDECODERES;
320 return (ct->ct_error.re_status);
328 register struct ct_data *ct =
331 *errp = ct->ct_error;
340 register struct ct_data *ct = (struct ct_data *)cl->cl_private;
341 register XDR *xdrs = &(ct->ct_xdrs);
358 register struct ct_data *ct = (struct ct_data *)cl->cl_private;
362 ct->ct_wait = *(struct timeval *)info;
363 ct->ct_waitset = TRUE;
366 *(struct timeval *)info = ct->ct_wait;
369 *(struct sockaddr_in *)info = ct->ct_addr;
372 *(int *)info = ct->ct_sock;
375 ct->ct_closeit = TRUE;
378 ct->ct_closeit = FALSE;
391 register struct ct_data *ct =
394 if (ct->ct_closeit) {
395 (void) close(ct->ct_sock);
397 XDR_DESTROY(&(ct->ct_xdrs));
398 mem_free((caddr_t)ct, sizeof (struct ct_data));
408 readtcp(ct, buf, len)
409 register struct ct_data *ct;
419 FD_SET(ct->ct_sock, &mask);
423 &readfds, NULL, NULL, &(ct->ct_wait))) {
425 ct->ct_error.re_status = RPC_TIMEDOUT;
431 ct->ct_error.re_status = RPC_CANTRECV;
432 ct->ct_error.re_errno = errno;
437 switch (len = read(ct->ct_sock, buf, len)) {
441 ct->ct_error.re_errno = ECONNRESET;
442 ct->ct_error.re_status = RPC_CANTRECV;
447 ct->ct_error.re_errno = errno;
448 ct->ct_error.re_status = RPC_CANTRECV;
455 writetcp(ct, buf, len)
456 struct ct_data *ct;
463 if ((i = write(ct->ct_sock, buf, cnt)) == -1) {
464 ct->ct_error.re_errno = errno;
465 ct->ct_error.re_status = RPC_CANTSEND;