From owner-freebsd-hackers Fri Jan 18 16:46:28 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from hoth.ffwd.cx (hoth.ffwd.cx [216.187.116.122]) by hub.freebsd.org (Postfix) with ESMTP id 145CC37B416 for ; Fri, 18 Jan 2002 16:46:26 -0800 (PST) Received: from skye by hoth.ffwd.cx with local (Exim 3.13 #1) id 16RjeE-000GC4-00 for hackers@freebsd.org; Fri, 18 Jan 2002 16:46:18 -0800 Date: Fri, 18 Jan 2002 16:46:18 -0800 From: Skye Poier To: hackers@freebsd.org Subject: mbuf chains Message-ID: <20020118164617.L99893@ffwd.cx> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0.1i X-URL: http://www.ffwd.cx/ Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG What are the rules around mbuf chain construction? (I've read man mbuf, doesnt go into much detail) In particular, I'm assuming: - all mbufs must be same type - the head mbuf must have M_PKTHDR set - the head mbuf.m_pkthdr.len must be the len of the entire chain Anything to add? My confusion is around splitting/concatenating - When splitting an mbuf chain, the two resultant chains must be as above (heads have M_PKTHDR and mbuf.m_pkthdr.len set) right? When concatenating chains, what do you do with the M_PKTHDR that is now in the middle of the chain? m_cat doesn't seem very sophisticated in this regard. And of course update head mbuf.m_pkthdr.len Thanks Skye To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message