Lines Matching refs:mdp

306 md_init(struct mdchain *mdp)  in md_init()  argument
312 md_initm(mdp, m); in md_init()
317 md_initm(struct mdchain *mdp, struct mbuf *m) in md_initm() argument
319 bzero(mdp, sizeof(*mdp)); in md_initm()
320 mdp->md_top = mdp->md_cur = m; in md_initm()
321 mdp->md_pos = mtod(m, u_char*); in md_initm()
325 md_done(struct mdchain *mdp) in md_done() argument
327 if (mdp->md_top) { in md_done()
328 m_freem(mdp->md_top); in md_done()
329 mdp->md_top = NULL; in md_done()
338 md_append_record(struct mdchain *mdp, struct mbuf *top) in md_append_record() argument
342 if (mdp->md_top == NULL) { in md_append_record()
343 md_initm(mdp, top); in md_append_record()
346 m = mdp->md_top; in md_append_record()
358 md_next_record(struct mdchain *mdp) in md_next_record() argument
362 if (mdp->md_top == NULL) in md_next_record()
364 m = mdp->md_top->m_nextpkt; in md_next_record()
365 md_done(mdp); in md_next_record()
368 md_initm(mdp, m); in md_next_record()
373 md_get_uint8(struct mdchain *mdp, uint8_t *x) in md_get_uint8() argument
375 return (md_get_mem(mdp, x, 1, MB_MINLINE)); in md_get_uint8()
379 md_get_uint16(struct mdchain *mdp, uint16_t *x) in md_get_uint16() argument
381 return (md_get_mem(mdp, (caddr_t)x, 2, MB_MINLINE)); in md_get_uint16()
385 md_get_uint16le(struct mdchain *mdp, uint16_t *x) in md_get_uint16le() argument
388 int error = md_get_uint16(mdp, &v); in md_get_uint16le()
396 md_get_uint16be(struct mdchain *mdp, uint16_t *x) in md_get_uint16be() argument
399 int error = md_get_uint16(mdp, &v); in md_get_uint16be()
407 md_get_uint32(struct mdchain *mdp, uint32_t *x) in md_get_uint32() argument
409 return (md_get_mem(mdp, (caddr_t)x, 4, MB_MINLINE)); in md_get_uint32()
413 md_get_uint32be(struct mdchain *mdp, uint32_t *x) in md_get_uint32be() argument
418 error = md_get_uint32(mdp, &v); in md_get_uint32be()
425 md_get_uint32le(struct mdchain *mdp, uint32_t *x) in md_get_uint32le() argument
430 error = md_get_uint32(mdp, &v); in md_get_uint32le()
437 md_get_int64(struct mdchain *mdp, int64_t *x) in md_get_int64() argument
439 return (md_get_mem(mdp, (caddr_t)x, 8, MB_MINLINE)); in md_get_int64()
443 md_get_int64be(struct mdchain *mdp, int64_t *x) in md_get_int64be() argument
448 error = md_get_int64(mdp, &v); in md_get_int64be()
455 md_get_int64le(struct mdchain *mdp, int64_t *x) in md_get_int64le() argument
460 error = md_get_int64(mdp, &v); in md_get_int64le()
467 md_get_mem(struct mdchain *mdp, caddr_t target, int size, int type) in md_get_mem() argument
469 struct mbuf *m = mdp->md_cur; in md_get_mem()
479 s = mdp->md_pos; in md_get_mem()
482 mdp->md_cur = m = m->m_next; in md_get_mem()
484 s = mdp->md_pos = mtod(m, caddr_t); in md_get_mem()
490 mdp->md_pos += count; in md_get_mem()
513 md_get_mbuf(struct mdchain *mdp, int size, struct mbuf **ret) in md_get_mbuf() argument
515 struct mbuf *m = mdp->md_cur, *rm; in md_get_mbuf()
517 rm = m_copym(m, mdp->md_pos - mtod(m, u_char*), size, M_WAITOK); in md_get_mbuf()
518 md_get_mem(mdp, NULL, size, MB_MZERO); in md_get_mbuf()
524 md_get_uio(struct mdchain *mdp, struct uio *uiop, int size) in md_get_uio() argument
543 error = md_get_mem(mdp, uiocp, left, mtype); in md_get_uio()