1 .\" $NetBSD: m_tag.9,v 1.3 2004/09/07 13:55:22 wiz Exp $
3 .\" Copyright (c)2004 YAMAMOTO Takashi,
4 .\" All rights reserved.
6 .\" Redistribution and use in source and binary forms, with or without
7 .\" modification, are permitted provided that the following conditions
9 .\" 1. Redistributions of source code must retain the above copyright
10 .\" notice, this list of conditions and the following disclaimer.
11 .\" 2. Redistributions in binary form must reproduce the above copyright
12 .\" notice, this list of conditions and the following disclaimer in the
13 .\" documentation and/or other materials provided with the distribution.
15 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
16 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
19 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 .\" ------------------------------------------------------------
38 .Nm m_tag_delete_chain ,
39 .Nm m_tag_delete_nonpersistent ,
42 .Nm m_tag_copy_chain ,
46 .Nd mbuf tagging interfaces
47 .\" ------------------------------------------------------------
51 .Fn m_tag_get "int type" "int len" "int wait"
53 .Fn m_tag_free "struct m_tag *t"
55 .Fn m_tag_prepend "struct mbuf *m" "struct m_tag *t"
57 .Fn m_tag_unlink "struct mbuf *m" "struct m_tag *t"
59 .Fn m_tag_delete "struct mbuf *m" "struct m_tag *t"
61 .Fn m_tag_delete_chain "struct mbuf *m" "struct m_tag *t"
63 .Fn m_tag_delete_nonpersistent "struct mbuf *"
65 .Fn m_tag_find "struct mbuf *m" "int type" "struct m_tag *t"
67 .Fn m_tag_copy "struct m_tag *m"
69 .Fn m_tag_copy_chain "struct mbuf *to" "struct mbuf *from"
71 .Fn m_tag_init "struct mbuf *m"
73 .Fn m_tag_first "struct mbuf *m"
75 .Fn m_tag_next "struct mbuf *m" "struct m_tag *t"
76 .\" ------------------------------------------------------------
84 .\" ------------------------------------------------------------
86 .Bl -tag -width compact
87 .\" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
88 .It Fn m_tag_get "type" "len" "wait"
95 is the size of the data associated with the tag, in bytes.
101 .\" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
102 .It Fn m_tag_free "t"
105 .\" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
106 .It Fn m_tag_prepend "m" "t"
112 will become the first tag of the mbuf
119 .\" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
120 .It Fn m_tag_unlink "m" "t"
125 .\" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
126 .It Fn m_tag_delete "m" "t"
131 .\" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
132 .It Fn m_tag_delete_chain "m" "t"
133 Unlink and free mbuf tags beginning with the mbuf tag
141 .Fn m_tag_delete_chain
142 unlinks and frees all mbuf tags associated with the mbuf
144 .\" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
145 .It Fn m_tag_delete_nonpersistent "m"
146 Unlink and free all non persistent tags associated with the mbuf
148 .\" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
149 .It Fn m_tag_find "m" "type" "t"
150 Find an mbuf tag with type
154 in the tag chain associated with the mbuf
160 search from the first mbuf tag.
161 If an mbuf tag is found, return a pointer to it.
164 .\" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
165 .It Fn m_tag_copy "t"
168 Return a new mbuf tag on success.
171 .\" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
172 .It Fn m_tag_copy_chain "to" "from"
173 Copy all mbuf tags associated with the mbuf
179 already has any mbuf tags, they will be unlinked and freed beforehand.
182 .\" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
183 .It Fn m_tag_init "m"
184 Initialize mbuf tag chain of the mbuf
186 .\" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
187 .It Fn m_tag_first "m"
188 Return the first mbuf tag associated with the mbuf
192 if no mbuf tags are found.
193 .\" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
194 .It Fn m_tag_next "m" "t"
195 Return the next mbuf tag after
197 associated with the mbuf
203 is the last tag in the chain.
204 .\" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
206 .\" ------------------------------------------------------------
208 This section describes places within the
210 source tree where actual code implementing the mbuf tagging interfaces
212 All pathnames are relative to
215 The mbuf tagging interfaces are implemented within the file
216 .Pa sys/kern/uipc_mbuf2.c .
220 macros are defined in the file
226 .\" ------------------------------------------------------------
228 The semantics of the term "persistent tag" are vague.