diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2018-08-09 23:52:59 +0200 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2018-10-07 19:40:30 +0200 |
commit | 632dd719b385016eb62273f12fe51512453624c1 (patch) | |
tree | 2f2921546b351d8d59219386a509f76fff8e17dd /slirp/mbuf.h | |
parent | 3c2d3042849686969add641bd38b08b9877b9e8f (diff) |
slirp: document mbuf pointers and sizes
and fix confusing datasize name into gapsize in m_inc.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Diffstat (limited to 'slirp/mbuf.h')
-rw-r--r-- | slirp/mbuf.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/slirp/mbuf.h b/slirp/mbuf.h index 33b84485d6..bfdf8c4577 100644 --- a/slirp/mbuf.h +++ b/slirp/mbuf.h @@ -48,6 +48,19 @@ */ /* + * mbufs allow to have a gap between the start of the allocated buffer (m_ext if + * M_EXT is set, m_dat otherwise) and the in-use data: + * + * |--gapsize----->|---m_len-------> + * |----------m_size------------------------------> + * |----M_ROOM--------------------> + * |-M_FREEROOM--> + * + * ^ ^ ^ + * m_dat/m_ext m_data end of buffer + */ + +/* * How much room is in the mbuf, from m_data to the end of the mbuf */ #define M_ROOM(m) ((m->m_flags & M_EXT)? \ |