Lines Matching defs:xdrs
111 xdrmblk_init(XDR *xdrs, mblk_t *m, enum xdr_op op, int sz)
115 xdrs->x_op = op;
116 xdrs->x_ops = &xdrmblk_ops;
117 xdrs->x_base = (caddr_t)m;
118 xdrs->x_public = NULL;
120 xdrs->x_private = (caddr_t)p;
127 xdrs->x_handy = (int)MBLKL(m);
129 xdrs->x_handy = (int)MBLKTAIL(m);
136 xdrmblk_destroy(XDR *xdrs)
138 kmem_free(xdrs->x_private, sizeof (struct xdrmblk_params));
142 xdrmblk_getint32(XDR *xdrs, int32_t *int32p)
147 xdrmblk_skip_fully_read_mblks(xdrs);
150 m = (mblk_t *)xdrs->x_base;
154 p = (struct xdrmblk_params *)xdrs->x_private;
162 xdrs->x_handy < sizeof (int32_t)) {
174 xdrs->x_handy = (int)MBLKL(m);
180 xdrs->x_handy -= sizeof (int32_t);
187 xdrmblk_putint32(XDR *xdrs, int32_t *int32p)
193 m = (mblk_t *)xdrs->x_base;
197 p = (struct xdrmblk_params *)xdrs->x_private;
200 xdrs->x_handy < sizeof (int32_t)) {
206 xdrs->x_base = (caddr_t)m;
210 xdrs->x_handy = 0;
213 xdrs->x_handy = (int)MBLKTAIL(m);
221 xdrs->x_handy -= sizeof (int32_t);
233 xdrmblk_getbytes(XDR *xdrs, caddr_t addr, int len)
240 m = (mblk_t *)xdrs->x_base;
244 p = (struct xdrmblk_params *)xdrs->x_private;
254 while (xdrs->x_handy < len) {
255 if (xdrs->x_handy > 0) {
256 if (xdrs->x_handy < XDRMBLK_BCOPY_LIMIT) {
257 for (i = 0; i < xdrs->x_handy; i++)
260 bcopy(m->b_rptr, addr, xdrs->x_handy);
261 m->b_rptr += xdrs->x_handy;
262 addr += xdrs->x_handy;
264 len -= xdrs->x_handy;
265 p->rpos += xdrs->x_handy;
268 xdrs->x_base = (caddr_t)m;
272 xdrs->x_handy = 0;
275 xdrs->x_handy = (int)MBLKL(m);
278 xdrs->x_handy -= len;
301 xdrmblk_getmblk(XDR *xdrs, mblk_t **mm, uint_t *lenp)
308 if (!xdrmblk_getint32(xdrs, (int32_t *)&llen))
313 m = (mblk_t *)xdrs->x_base;
350 xdrs->x_base = (caddr_t)m;
351 xdrs->x_handy = m != NULL ? MBLKL(m) : 0;
353 p = (struct xdrmblk_params *)xdrs->x_private;
361 xdrmblk_putbytes(XDR *xdrs, caddr_t addr, int len)
368 m = (mblk_t *)xdrs->x_base;
372 p = (struct xdrmblk_params *)xdrs->x_private;
382 while (xdrs->x_handy < len) {
383 if (xdrs->x_handy > 0) {
384 if (xdrs->x_handy < XDRMBLK_BCOPY_LIMIT) {
385 for (i = 0; i < xdrs->x_handy; i++)
388 bcopy(addr, m->b_wptr, xdrs->x_handy);
389 m->b_wptr += xdrs->x_handy;
390 addr += xdrs->x_handy;
392 len -= xdrs->x_handy;
393 p->rpos += xdrs->x_handy;
406 xdrs->x_base = (caddr_t)m;
410 xdrs->x_handy = 0;
413 xdrs->x_handy = (int)MBLKTAIL(m);
419 xdrs->x_handy -= len;
442 xdrmblk_putmblk(XDR *xdrs, mblk_t *m, uint_t len)
446 if (!xdrmblk_putint32(xdrs, &llen))
449 return (xdrmblk_putmblk_raw(xdrs, m));
456 xdrmblk_putmblk_raw(XDR *xdrs, mblk_t *m)
463 p = (struct xdrmblk_params *)xdrs->x_private;
466 ((mblk_t *)xdrs->x_base)->b_cont = m;
474 xdrs->x_base = (caddr_t)m;
475 xdrs->x_handy = 0;
481 xdrmblk_getpos(XDR *xdrs)
483 struct xdrmblk_params *p = (struct xdrmblk_params *)xdrs->x_private;
489 xdrmblk_setpos(XDR *xdrs, uint_t pos)
494 p = (struct xdrmblk_params *)xdrs->x_private;
499 if (pos > p->apos + p->rpos + xdrs->x_handy)
506 m = (mblk_t *)xdrs->x_base;
509 if (xdrs->x_op == XDR_DECODE)
514 xdrs->x_handy = p->rpos + xdrs->x_handy - (pos - p->apos);
527 xdrmblk_inline(XDR *xdrs, int len)
537 if (xdrs->x_op == XDR_FREE)
547 if (xdrs->x_op == XDR_DECODE)
548 xdrmblk_skip_fully_read_mblks(xdrs);
553 if (len <= 0 || xdrs->x_handy < len) {
561 m = (mblk_t *)xdrs->x_base;
564 if (xdrs->x_op == XDR_DECODE) {
589 p = (struct xdrmblk_params *)xdrs->x_private;
592 xdrs->x_handy -= len;
603 xdrmblk_control(XDR *xdrs, int request, void *info)
612 xdrmblk_skip_fully_read_mblks(xdrs);
617 if (xdrs->x_handy < sizeof (int32_t))
621 m = (mblk_t *)xdrs->x_base;
644 m = (mblk_t *)xdrs->x_base;
648 p = (struct xdrmblk_params *)xdrs->x_private;
650 while (xdrs->x_handy < len) {
651 if (xdrs->x_handy > 0) {
652 m->b_rptr += xdrs->x_handy;
653 len -= xdrs->x_handy;
654 p->rpos += xdrs->x_handy;
657 xdrs->x_base = (caddr_t)m;
661 xdrs->x_handy = 0;
664 xdrs->x_handy = (int)MBLKL(m);
667 xdrs->x_handy -= len;
708 xdrmblk_skip_fully_read_mblks(XDR *xdrs)
713 if (xdrs->x_handy != 0)
717 m = (mblk_t *)xdrs->x_base;
721 p = (struct xdrmblk_params *)xdrs->x_private;
730 xdrs->x_handy = (int)MBLKL(m);
731 } while (xdrs->x_handy == 0);
733 xdrs->x_base = (caddr_t)m;