M_TAG(9)
π NAME π
okay so bestie, welcome to M_TAG(9) from the Kernel Developerβs Manual β this is the mbuf-tagging crew: m_tag, m_tag_get, m_tag_free, m_tag_prepend, m_tag_unlink, m_tag_delete, m_tag_delete_chain, m_tag_find, m_tag_copy, and m_tag_copy_chain. Their whole thing is mbuf tagging interfaces β¨
πΈ SYNOPSIS πΈ
#include <sys/mbuf.h>
struct m_tag *
m_tag_get(int type, int len, int wait);
void
m_tag_free(struct m_tag *t);
void
m_tag_prepend(struct mbuf *m, struct m_tag *t);
void
m_tag_unlink(struct mbuf *m, struct m_tag *t);
void
m_tag_delete(struct mbuf *m, struct m_tag *t);
void
m_tag_delete_chain(struct mbuf *m);
struct m_tag *
m_tag_find(struct mbuf *m, int type);
struct m_tag *
m_tag_copy(struct m_tag *m);
int
m_tag_copy_chain(struct mbuf *to, struct mbuf *from);
π¦ DESCRIPTION π¦
so the m_tag interface is used to βtagβ mbufs. Thatβs the whole plot, no cap. π
π₯ FUNCTIONS π₯
m_tag_get(type, len, wait)β allocates an mbuf tag.typeis one of thePACKET_TAG_macros.lenis the size of the data associated with the tag, in bytes.waitis eitherM_WAITOKorM_NOWAIT. πm_tag_free(t)β frees the mbuf tagt. π§m_tag_prepend(m, t)β prepends the mbuf tagtto the mbufm.twill become the first tag of the mbufm. Whenmis freed,twill also be freed. π¦m_tag_unlink(m, t)β unlinks the mbuf tagtfrom the mbufm. πm_tag_delete(m, t)β the same asm_tag_unlink()followed bym_tag_free(). π«Άm_tag_delete_chain(m)β unlinks and frees mbuf tags from the mbufm. πm_tag_find(m, type)β finds an mbuf tag with typetypein the tag chain associated with the mbufm. If an mbuf tag is found, return a pointer to it. Otherwise returnNULL. πm_tag_copy(t)β copies an mbuf tagt. Returns a new mbuf tag on success. Otherwise returnsNULL. β¨m_tag_copy_chain(to, from)β copies all mbuf tags associated with the mbuffromto the mbufto. Iftoalready has any mbuf tags, they will be unlinked and freed beforehand. Returns1on success. Otherwise returns0. π
β CODE REFERENCES β
The mbuf tagging interfaces are implemented within the file sys/kern/uipc_mbuf.c. π οΈ
The PACKET_TAG_ macros are defined in the file sys/sys/mbuf.h. π
π SEE ALSO π
π BUGS π
The semantics of the term "persistent tag" are vague. lowkey mysterious, highkey vague. π
okay thatβs the page, bestie β source/version is Debian, dated November 15, 2018, and this whole thing is M_TAG(9). bye bestie, go tag those mbufs πβ¨π«Ά
π¦ where this page comes from
- nixpkgs unstable: netbsd-source 11.0
- Copyright (c)2004 YAMAMOTO Takashi
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms