diff options
author | phk <phk@FreeBSD.org> | 1999-11-01 15:03:20 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 1999-11-01 15:03:20 +0000 |
commit | d4a4beb863fbb08e18b039a4ddc798f4029a7c38 (patch) | |
tree | 277e6a8eaaa652676203d60cf99de61b92075771 /sys/kern/uipc_mbuf.c | |
parent | 9876a339ec8e9f4e1a84431eb38c128d41c0ec13 (diff) | |
download | FreeBSD-src-d4a4beb863fbb08e18b039a4ddc798f4029a7c38.zip FreeBSD-src-d4a4beb863fbb08e18b039a4ddc798f4029a7c38.tar.gz |
New function:
m_print(struct mbuf *);
hexdumps a mbuf.
Diffstat (limited to 'sys/kern/uipc_mbuf.c')
-rw-r--r-- | sys/kern/uipc_mbuf.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/sys/kern/uipc_mbuf.c b/sys/kern/uipc_mbuf.c index d84cf0b..619f3a6 100644 --- a/sys/kern/uipc_mbuf.c +++ b/sys/kern/uipc_mbuf.c @@ -951,3 +951,19 @@ m_copyback(m0, off, len, cp) out: if (((m = m0)->m_flags & M_PKTHDR) && (m->m_pkthdr.len < totlen)) m->m_pkthdr.len = totlen; } + +void +m_print(const struct mbuf *m) +{ + int len; + struct mbuf *m2; + + len = m->m_pkthdr.len; + m2 = m; + while (len) { + printf("%p %*D\n", m2, m2->m_len, (u_char *)m2->m_data, "-"); + len -= m2->m_len; + m2 = m2->m_next; + } + return; +} |