Index: sys/mbuf.h =================================================================== RCS file: /home/ncvs/src/sys/sys/mbuf.h,v retrieving revision 1.122 diff -u -r1.122 mbuf.h --- sys/mbuf.h 9 May 2003 02:15:52 -0000 1.122 +++ sys/mbuf.h 4 Jun 2003 03:45:59 -0000 @@ -404,6 +404,22 @@ } while (0) /* + * Get a mbuf in a generic way. + * -m: mbuf to allocate + * -len: size (optional) + * -type: type of the mbuf (MT_DATA etc) + * -ispkthdr: if it should be a packet header (M_PKTHDR or 0) + */ +#define M_GET_GENERIC(m, len, how, type, ispkthdr) do { \ + if ((len) >= MINCLSIZE) \ + m = m_getcl(how, type, ispkthdr); \ + else if ((ispkthdr) & M_PKTHDR) \ + m = m_gethdr(how, type); \ + else \ + m = m_get(how, type); \ +} while (0) + +/* * Change mbuf to new type. * This is a relatively expensive operation and should be avoided. */