Lines Matching refs:rstrm
143 RECSTREAM *rstrm = (RECSTREAM *) mem_alloc (sizeof (RECSTREAM)); in xdrrec_create() local
151 if (rstrm == NULL || buf == NULL) in xdrrec_create()
154 mem_free (rstrm, sizeof (RECSTREAM)); in xdrrec_create()
165 rstrm->sendsize = sendsize; in xdrrec_create()
166 rstrm->recvsize = recvsize; in xdrrec_create()
167 rstrm->the_buffer = buf; in xdrrec_create()
168 tmp = rstrm->the_buffer; in xdrrec_create()
171 rstrm->out_base = tmp; in xdrrec_create()
172 rstrm->in_base = tmp + sendsize; in xdrrec_create()
179 xdrs->x_private = (caddr_t) rstrm; in xdrrec_create()
180 rstrm->tcp_handle = tcp_handle; in xdrrec_create()
181 rstrm->readit = readit; in xdrrec_create()
182 rstrm->writeit = writeit; in xdrrec_create()
183 rstrm->out_finger = rstrm->out_boundry = rstrm->out_base; in xdrrec_create()
184 rstrm->frag_header = (uint32_t *) rstrm->out_base; in xdrrec_create()
185 rstrm->out_finger += 4; in xdrrec_create()
186 rstrm->out_boundry += sendsize; in xdrrec_create()
187 rstrm->frag_sent = FALSE; in xdrrec_create()
188 rstrm->in_size = recvsize; in xdrrec_create()
189 rstrm->in_boundry = rstrm->in_base; in xdrrec_create()
190 rstrm->in_finger = (rstrm->in_boundry += recvsize); in xdrrec_create()
191 rstrm->fbtbc = 0; in xdrrec_create()
192 rstrm->last_frag = TRUE; in xdrrec_create()
205 RECSTREAM *rstrm = (RECSTREAM *) xdrs->x_private; in libc_hidden_nolink_sunrpc() local
206 int32_t *buflp = (int32_t *) rstrm->in_finger; in libc_hidden_nolink_sunrpc()
210 if (rstrm->fbtbc >= BYTES_PER_XDR_UNIT && in libc_hidden_nolink_sunrpc()
211 rstrm->in_boundry - (char *) buflp >= BYTES_PER_XDR_UNIT) in libc_hidden_nolink_sunrpc()
214 rstrm->fbtbc -= BYTES_PER_XDR_UNIT; in libc_hidden_nolink_sunrpc()
215 rstrm->in_finger += BYTES_PER_XDR_UNIT; in libc_hidden_nolink_sunrpc()
230 RECSTREAM *rstrm = (RECSTREAM *) xdrs->x_private; in xdrrec_putlong() local
231 int32_t *dest_lp = (int32_t *) rstrm->out_finger; in xdrrec_putlong()
233 if ((rstrm->out_finger += BYTES_PER_XDR_UNIT) > rstrm->out_boundry) in xdrrec_putlong()
239 rstrm->out_finger -= BYTES_PER_XDR_UNIT; in xdrrec_putlong()
240 rstrm->frag_sent = TRUE; in xdrrec_putlong()
241 if (!flush_out (rstrm, FALSE)) in xdrrec_putlong()
243 dest_lp = (int32_t *) rstrm->out_finger; in xdrrec_putlong()
244 rstrm->out_finger += BYTES_PER_XDR_UNIT; in xdrrec_putlong()
253 RECSTREAM *rstrm = (RECSTREAM *) xdrs->x_private; in xdrrec_getbytes() local
258 current = rstrm->fbtbc; in xdrrec_getbytes()
261 if (rstrm->last_frag) in xdrrec_getbytes()
263 if (!set_input_fragment (rstrm)) in xdrrec_getbytes()
268 if (!get_input_bytes (rstrm, addr, current)) in xdrrec_getbytes()
271 rstrm->fbtbc -= current; in xdrrec_getbytes()
280 RECSTREAM *rstrm = (RECSTREAM *) xdrs->x_private; in xdrrec_putbytes() local
285 current = rstrm->out_boundry - rstrm->out_finger; in xdrrec_putbytes()
287 memcpy (rstrm->out_finger, addr, current); in xdrrec_putbytes()
288 rstrm->out_finger += current; in xdrrec_putbytes()
291 if (rstrm->out_finger == rstrm->out_boundry && len > 0) in xdrrec_putbytes()
293 rstrm->frag_sent = TRUE; in xdrrec_putbytes()
294 if (!flush_out (rstrm, FALSE)) in xdrrec_putbytes()
304 RECSTREAM *rstrm = (RECSTREAM *) xdrs->x_private; in xdrrec_getpos() local
307 pos = __lseek ((int) (long) rstrm->tcp_handle, (long) 0, 1); in xdrrec_getpos()
313 pos += rstrm->out_finger - rstrm->out_base; in xdrrec_getpos()
317 pos -= rstrm->in_boundry - rstrm->in_finger; in xdrrec_getpos()
330 RECSTREAM *rstrm = (RECSTREAM *) xdrs->x_private; in xdrrec_setpos() local
340 newpos = rstrm->out_finger - delta; in xdrrec_setpos()
341 if (newpos > (caddr_t) rstrm->frag_header && in xdrrec_setpos()
342 newpos < rstrm->out_boundry) in xdrrec_setpos()
344 rstrm->out_finger = newpos; in xdrrec_setpos()
350 newpos = rstrm->in_finger - delta; in xdrrec_setpos()
351 if ((delta < (int) (rstrm->fbtbc)) && in xdrrec_setpos()
352 (newpos <= rstrm->in_boundry) && in xdrrec_setpos()
353 (newpos >= rstrm->in_base)) in xdrrec_setpos()
355 rstrm->in_finger = newpos; in xdrrec_setpos()
356 rstrm->fbtbc -= delta; in xdrrec_setpos()
370 RECSTREAM *rstrm = (RECSTREAM *) xdrs->x_private; in xdrrec_inline() local
377 if ((rstrm->out_finger + len) <= rstrm->out_boundry) in xdrrec_inline()
379 buf = (int32_t *) rstrm->out_finger; in xdrrec_inline()
380 rstrm->out_finger += len; in xdrrec_inline()
385 if ((len <= rstrm->fbtbc) && in xdrrec_inline()
386 ((rstrm->in_finger + len) <= rstrm->in_boundry)) in xdrrec_inline()
388 buf = (int32_t *) rstrm->in_finger; in xdrrec_inline()
389 rstrm->fbtbc -= len; in xdrrec_inline()
390 rstrm->in_finger += len; in xdrrec_inline()
403 RECSTREAM *rstrm = (RECSTREAM *) xdrs->x_private; in xdrrec_destroy() local
405 mem_free (rstrm->the_buffer, in xdrrec_destroy()
406 rstrm->sendsize + rstrm->recvsize + BYTES_PER_XDR_UNIT); in xdrrec_destroy()
407 mem_free ((caddr_t) rstrm, sizeof (RECSTREAM)); in xdrrec_destroy()
413 RECSTREAM *rstrm = (RECSTREAM *) xdrs->x_private; in xdrrec_getint32() local
414 int32_t *bufip = (int32_t *) rstrm->in_finger; in xdrrec_getint32()
418 if (rstrm->fbtbc >= BYTES_PER_XDR_UNIT && in xdrrec_getint32()
419 rstrm->in_boundry - (char *) bufip >= BYTES_PER_XDR_UNIT) in xdrrec_getint32()
422 rstrm->fbtbc -= BYTES_PER_XDR_UNIT; in xdrrec_getint32()
423 rstrm->in_finger += BYTES_PER_XDR_UNIT; in xdrrec_getint32()
438 RECSTREAM *rstrm = (RECSTREAM *) xdrs->x_private; in xdrrec_putint32() local
439 int32_t *dest_ip = (int32_t *) rstrm->out_finger; in xdrrec_putint32()
441 if ((rstrm->out_finger += BYTES_PER_XDR_UNIT) > rstrm->out_boundry) in xdrrec_putint32()
447 rstrm->out_finger -= BYTES_PER_XDR_UNIT; in xdrrec_putint32()
448 rstrm->frag_sent = TRUE; in xdrrec_putint32()
449 if (!flush_out (rstrm, FALSE)) in xdrrec_putint32()
451 dest_ip = (int32_t *) rstrm->out_finger; in xdrrec_putint32()
452 rstrm->out_finger += BYTES_PER_XDR_UNIT; in xdrrec_putint32()
469 RECSTREAM *rstrm = (RECSTREAM *) xdrs->x_private; in xdrrec_skiprecord() local
471 while (rstrm->fbtbc > 0 || (!rstrm->last_frag)) in xdrrec_skiprecord()
473 if (!skip_input_bytes (rstrm, rstrm->fbtbc)) in xdrrec_skiprecord()
475 rstrm->fbtbc = 0; in xdrrec_skiprecord()
476 if ((!rstrm->last_frag) && (!set_input_fragment (rstrm))) in xdrrec_skiprecord()
479 rstrm->last_frag = FALSE; in xdrrec_skiprecord()
492 RECSTREAM *rstrm = (RECSTREAM *) xdrs->x_private; in libc_hidden_nolink_sunrpc() local
494 while (rstrm->fbtbc > 0 || (!rstrm->last_frag)) in libc_hidden_nolink_sunrpc()
496 if (!skip_input_bytes (rstrm, rstrm->fbtbc)) in libc_hidden_nolink_sunrpc()
498 rstrm->fbtbc = 0; in libc_hidden_nolink_sunrpc()
499 if ((!rstrm->last_frag) && (!set_input_fragment (rstrm))) in libc_hidden_nolink_sunrpc()
502 if (rstrm->in_finger == rstrm->in_boundry) in libc_hidden_nolink_sunrpc()
517 RECSTREAM *rstrm = (RECSTREAM *) xdrs->x_private; in libc_hidden_nolink_sunrpc() local
520 if (sendnow || rstrm->frag_sent in libc_hidden_nolink_sunrpc()
521 || rstrm->out_finger + BYTES_PER_XDR_UNIT >= rstrm->out_boundry) in libc_hidden_nolink_sunrpc()
523 rstrm->frag_sent = FALSE; in libc_hidden_nolink_sunrpc()
524 return flush_out (rstrm, TRUE); in libc_hidden_nolink_sunrpc()
526 len = (rstrm->out_finger - (char *) rstrm->frag_header in libc_hidden_nolink_sunrpc()
528 *rstrm->frag_header = htonl ((u_long) len | LAST_FRAG); in libc_hidden_nolink_sunrpc()
529 rstrm->frag_header = (uint32_t *) rstrm->out_finger; in libc_hidden_nolink_sunrpc()
530 rstrm->out_finger += BYTES_PER_XDR_UNIT; in libc_hidden_nolink_sunrpc()
540 flush_out (RECSTREAM *rstrm, bool_t eor) in libc_hidden_nolink_sunrpc()
543 u_long len = (rstrm->out_finger - (char *) rstrm->frag_header in libc_hidden_nolink_sunrpc()
546 *rstrm->frag_header = htonl (len | eormask); in libc_hidden_nolink_sunrpc()
547 len = rstrm->out_finger - rstrm->out_base; in libc_hidden_nolink_sunrpc()
548 if ((*(rstrm->writeit)) (rstrm->tcp_handle, rstrm->out_base, (int) len) in libc_hidden_nolink_sunrpc()
551 rstrm->frag_header = (uint32_t *) rstrm->out_base; in libc_hidden_nolink_sunrpc()
552 rstrm->out_finger = (caddr_t) rstrm->out_base + BYTES_PER_XDR_UNIT; in libc_hidden_nolink_sunrpc()
557 fill_input_buf (RECSTREAM *rstrm) in fill_input_buf() argument
563 where = rstrm->in_base; in fill_input_buf()
564 i = (size_t) rstrm->in_boundry % BYTES_PER_XDR_UNIT; in fill_input_buf()
566 len = rstrm->in_size - i; in fill_input_buf()
567 if ((len = (*(rstrm->readit)) (rstrm->tcp_handle, where, len)) == -1) in fill_input_buf()
569 rstrm->in_finger = where; in fill_input_buf()
571 rstrm->in_boundry = where; in fill_input_buf()
576 get_input_bytes (RECSTREAM *rstrm, caddr_t addr, int len) in get_input_bytes() argument
582 current = rstrm->in_boundry - rstrm->in_finger; in get_input_bytes()
585 if (!fill_input_buf (rstrm)) in get_input_bytes()
590 memcpy (addr, rstrm->in_finger, current); in get_input_bytes()
591 rstrm->in_finger += current; in get_input_bytes()
599 set_input_fragment (RECSTREAM *rstrm) in set_input_fragment() argument
603 if (! get_input_bytes (rstrm, (caddr_t)&header, BYTES_PER_XDR_UNIT)) in set_input_fragment()
606 rstrm->last_frag = ((header & LAST_FRAG) == 0) ? FALSE : TRUE; in set_input_fragment()
619 rstrm->fbtbc = header & ~LAST_FRAG; in set_input_fragment()
624 skip_input_bytes (RECSTREAM *rstrm, long cnt) in skip_input_bytes() argument
630 current = rstrm->in_boundry - rstrm->in_finger; in skip_input_bytes()
633 if (!fill_input_buf (rstrm)) in skip_input_bytes()
638 rstrm->in_finger += current; in skip_input_bytes()