Lines Matching refs:nbuf
84 ndr_buf_t *nbuf;
86 if ((nbuf = calloc(1, sizeof (ndr_buf_t))) == NULL)
89 if ((nbuf->nb_heap = ndr_heap_create()) == NULL) {
90 free(nbuf);
94 nbuf->nb_ti = ti;
95 nbuf->nb_magic = NDR_BUF_MAGIC;
96 return (nbuf);
100 ndr_buf_fini(ndr_buf_t *nbuf)
102 assert(nbuf->nb_magic == NDR_BUF_MAGIC);
104 nds_destruct(&nbuf->nb_nds);
105 ndr_heap_destroy(nbuf->nb_heap);
106 nbuf->nb_magic = 0;
107 free(nbuf);
118 * if ((nbuf = ndr_buf_init(&TYPEINFO(ndr_pac)) != NULL) {
119 * rc = ndr_decode_buf(nbuf, opnum, data, datalen, &info);
121 * ndr_buf_fini(nbuf);
125 ndr_buf_decode(ndr_buf_t *nbuf, unsigned hdr_type, unsigned opnum,
133 assert(nbuf->nb_magic == NDR_BUF_MAGIC);
134 assert(nbuf->nb_heap != NULL);
135 assert(nbuf->nb_ti != NULL);
142 rc = nds_initialize(&nbuf->nb_nds, pdu_size_hint, NDR_MODE_BUF_DECODE,
143 nbuf->nb_heap);
147 bcopy(data, nbuf->nb_nds.pdu_base_addr, datalen);
151 rc = ndr_decode_hdr_common(&nbuf->nb_nds, &hdr);
160 rc = ndr_decode_pac_hdr(&nbuf->nb_nds, &pac_hdr);
172 rc = ndr_encode_decode_common(&nbuf->nb_nds, opnum, nbuf->nb_ti,