merge ROS Shell without integrated explorer part into trunk
[reactos.git] / reactos / drivers / lib / oskittcp / include / freebsd / src / sys / sys / mbuf.h
1 /*
2 * Copyright (c) 1997-1998 University of Utah and the Flux Group.
3 * All rights reserved.
4 *
5 * This file is part of the Flux OSKit. The OSKit is free software, also known
6 * as "open source;" you can redistribute it and/or modify it under the terms
7 * of the GNU General Public License (GPL), version 2, as published by the Free
8 * Software Foundation (FSF). To explore alternate licensing terms, contact
9 * the University of Utah at csl-dist@cs.utah.edu or +1-801-585-3271.
10 *
11 * The OSKit is distributed in the hope that it will be useful, but WITHOUT ANY
12 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
13 * FOR A PARTICULAR PURPOSE. See the GPL for more details. You should have
14 * received a copy of the GPL along with the OSKit; see the file COPYING. If
15 * not, write to the FSF, 59 Temple Place #330, Boston, MA 02111-1307, USA.
16 */
17 /*
18 * Copyright (c) 1982, 1986, 1988, 1993
19 * The Regents of the University of California. All rights reserved.
20 *
21 * Redistribution and use in source and binary forms, with or without
22 * modification, are permitted provided that the following conditions
23 * are met:
24 * 1. Redistributions of source code must retain the above copyright
25 * notice, this list of conditions and the following disclaimer.
26 * 2. Redistributions in binary form must reproduce the above copyright
27 * notice, this list of conditions and the following disclaimer in the
28 * documentation and/or other materials provided with the distribution.
29 * 3. All advertising materials mentioning features or use of this software
30 * must display the following acknowledgement:
31 * This product includes software developed by the University of
32 * California, Berkeley and its contributors.
33 * 4. Neither the name of the University nor the names of its contributors
34 * may be used to endorse or promote products derived from this software
35 * without specific prior written permission.
36 *
37 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
38 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
39 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
40 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
41 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
42 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
43 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
44 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
45 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
46 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
47 * SUCH DAMAGE.
48 *
49 * @(#)mbuf.h 8.3 (Berkeley) 1/21/94
50 * $\Id: mbuf.h,v 1.9 1994/11/14 13:54:20 bde Exp $
51 */
52
53 #ifndef _SYS_MBUF_H_
54 #define _SYS_MBUF_H_
55
56 #ifndef M_WAITOK
57 #include <sys/malloc.h>
58 #endif
59
60 #ifndef OSKIT
61 #ifdef __REACTOS__
62 /* #define OSKIT */
63 #define LOCAL_OSKIT_DEFINED
64 #endif
65 #endif
66
67 /*
68 * Mbufs are of a single size, MSIZE (machine/machparam.h), which
69 * includes overhead. An mbuf may add a single "mbuf cluster" of size
70 * MCLBYTES (also in machine/machparam.h), which has no additional overhead
71 * and is used instead of the internal data area; this is done when
72 * at least MINCLSIZE of data must be stored.
73 */
74
75 #define MLEN (MSIZE - sizeof(struct m_hdr)) /* normal data len */
76 #define MHLEN (MLEN - sizeof(struct pkthdr)) /* data len w/pkthdr */
77
78 #define MINCLSIZE (MHLEN + MLEN) /* smallest amount to put in cluster */
79 #define M_MAXCOMPRESS (MHLEN / 2) /* max amount to copy for compression */
80
81 /*
82 * Macros for type conversion
83 * mtod(m,t) - convert mbuf pointer to data pointer of correct type
84 * dtom(x) - convert data pointer within mbuf to mbuf pointer (XXX)
85 * mtocl(x) - convert pointer within cluster to cluster index #
86 * cltom(x) - convert cluster # to ptr to beginning of cluster
87 */
88 #define mtod(m,t) ((t)((m)->m_data))
89 #ifndef __REACTOS__
90 #define dtom(x) ((struct mbuf *)((int)(x) & ~(MSIZE-1)))
91 #else
92 #define dtom(x) ((struct mbuf *)((int)(x) - sizeof(struct m_hdr)))
93 #endif
94 #ifndef OSKIT
95 #define mtocl(x) (((u_int)(x) - (u_int)mbutl) >> MCLSHIFT)
96 #define cltom(x) ((caddr_t)((u_int)mbutl + ((u_int)(x) << MCLSHIFT)))
97 #endif /* OSKIT */
98
99 /* header at beginning of each mbuf: */
100 struct m_hdr {
101 struct mbuf *mh_next; /* next buffer in chain */
102 struct mbuf *mh_nextpkt; /* next chain in queue/record */
103 int mh_len; /* amount of data in this mbuf */
104 caddr_t mh_data; /* location of data */
105 short mh_type; /* type of data in this mbuf */
106 short mh_flags; /* flags; see below */
107 };
108
109 /* record/packet header in first mbuf of chain; valid if M_PKTHDR set */
110 struct pkthdr {
111 int len; /* total packet length */
112 struct ifnet *rcvif; /* rcv interface */
113 };
114
115 /* description of external storage mapped into mbuf, valid if M_EXT set */
116 struct m_ext {
117 caddr_t ext_buf; /* start of buffer */
118 #ifdef OSKIT
119 struct oskit_bufio *ext_bufio; /* OS Kit bufio pointer */
120 #else
121 void (*ext_free) /* free routine if not the usual */
122 __P((caddr_t, u_int));
123 #endif
124 u_int ext_size; /* size of buffer, for ext_free */
125 };
126
127 struct mbuf {
128 struct m_hdr m_hdr;
129 union {
130 struct {
131 struct pkthdr MH_pkthdr; /* M_PKTHDR set */
132 union {
133 struct m_ext MH_ext; /* M_EXT set */
134 char MH_databuf[MHLEN];
135 } MH_dat;
136 } MH;
137 char M_databuf[MLEN]; /* !M_PKTHDR, !M_EXT */
138 } M_dat;
139 };
140 #define m_next m_hdr.mh_next
141 #define m_len m_hdr.mh_len
142 #define m_data m_hdr.mh_data
143 #define m_type m_hdr.mh_type
144 #define m_flags m_hdr.mh_flags
145 #define m_nextpkt m_hdr.mh_nextpkt
146 #define m_act m_nextpkt
147 #define m_pkthdr M_dat.MH.MH_pkthdr
148 #define m_ext M_dat.MH.MH_dat.MH_ext
149 #define m_pktdat M_dat.MH.MH_dat.MH_databuf
150 #define m_dat M_dat.M_databuf
151
152 /* mbuf flags */
153 #if defined(OSKIT) && !defined(__REACTOS__)
154 #include <oskit/io/bufio.h>
155 /*
156 * A small step for mankind, but a huge leap for BSD:
157 * We consistently use oskit_bufios for external mbufs
158 */
159 #endif
160 #define M_EXT 0x0001 /* has associated external storage */
161 #define M_PKTHDR 0x0002 /* start of record */
162 #define M_EOR 0x0004 /* end of record */
163
164 /* mbuf pkthdr flags, also in m_flags */
165 #define M_BCAST 0x0100 /* send/received as link-level broadcast */
166 #define M_MCAST 0x0200 /* send/received as link-level multicast */
167
168 /* flags copied when copying m_pkthdr */
169 #define M_COPYFLAGS (M_PKTHDR|M_EOR|M_BCAST|M_MCAST)
170
171 /* mbuf types */
172 #define MT_FREE 0 /* should be on free list */
173 #define MT_DATA 1 /* dynamic (data) allocation */
174 #define MT_HEADER 2 /* packet header */
175 #define MT_SOCKET 3 /* socket structure */
176 #define MT_PCB 4 /* protocol control block */
177 #define MT_RTABLE 5 /* routing tables */
178 #define MT_HTABLE 6 /* IMP host tables */
179 #define MT_ATABLE 7 /* address resolution tables */
180 #define MT_SONAME 8 /* socket name */
181 #define MT_SOOPTS 10 /* socket options */
182 #define MT_FTABLE 11 /* fragment reassembly header */
183 #define MT_RIGHTS 12 /* access rights */
184 #define MT_IFADDR 13 /* interface address */
185 #define MT_CONTROL 14 /* extra-data protocol message */
186 #define MT_OOBDATA 15 /* expedited data */
187
188 /* flags to m_get/MGET */
189 #define M_DONTWAIT M_NOWAIT
190 #define M_WAIT M_WAITOK
191
192 /*
193 * mbuf utility macros:
194 *
195 * MBUFLOCK(code)
196 * prevents a section of code from from being interrupted by network
197 * drivers.
198 */
199 #define MBUFLOCK(code) \
200 { int ms = splimp(); \
201 { code } \
202 splx(ms); \
203 }
204
205 /*
206 * mbuf allocation/deallocation macros:
207 *
208 * MGET(struct mbuf *m, int how, int type)
209 * allocates an mbuf and initializes it to contain internal data.
210 *
211 * MGETHDR(struct mbuf *m, int how, int type)
212 * allocates an mbuf and initializes it to contain a packet header
213 * and internal data.
214 */
215 #define MGET(m, how, type) { \
216 MALLOC((m), struct mbuf *, MSIZE, mbtypes[type], (how)); \
217 OS_DbgPrint(OSK_MID_TRACE,("(MGET) got mbuf @ %x\n", m)); \
218 if (m) { \
219 (m)->m_type = (type); \
220 MBUFLOCK(mbstat.m_mtypes[type]++;) \
221 (m)->m_next = (struct mbuf *)NULL; \
222 (m)->m_nextpkt = (struct mbuf *)NULL; \
223 (m)->m_data = (m)->m_dat; \
224 (m)->m_flags = 0; \
225 } else \
226 (m) = m_retry((how), (type)); \
227 }
228
229 #define MGETHDR(m, how, type) { \
230 MALLOC((m), struct mbuf *, MSIZE, mbtypes[type], (how)); \
231 OS_DbgPrint(OSK_MID_TRACE,("(MGETHDR) got mbuf @ %x\n", m)); \
232 if (m) { \
233 (m)->m_type = (type); \
234 MBUFLOCK(mbstat.m_mtypes[type]++;) \
235 (m)->m_next = (struct mbuf *)NULL; \
236 (m)->m_nextpkt = (struct mbuf *)NULL; \
237 (m)->m_data = (m)->m_pktdat; \
238 (m)->m_flags = M_PKTHDR; \
239 } else \
240 (m) = m_retryhdr((how), (type)); \
241 }
242
243 #ifdef OSKIT
244 #define MGET_DONT_RECURSE(m, how, type) { \
245 MALLOC((m), struct mbuf *, MSIZE, mbtypes[type], (how)); \
246 OS_DbgPrint(OSK_MID_TRACE,("(MGET_DONT_RECURSE) got mbuf @ %x\n", m)); \
247 if (m) { \
248 (m)->m_type = (type); \
249 MBUFLOCK(mbstat.m_mtypes[type]++;) \
250 (m)->m_next = (struct mbuf *)NULL; \
251 (m)->m_nextpkt = (struct mbuf *)NULL; \
252 (m)->m_data = (m)->m_dat; \
253 (m)->m_flags = 0; \
254 } else \
255 (m) = (struct mbuf *)0; \
256 }
257
258 #define MGETHDR_DONT_RECURSE(m, how, type) { \
259 MALLOC((m), struct mbuf *, MSIZE, mbtypes[type], (how)); \
260 OS_DbgPrint(OSK_MID_TRACE,("(MGETHDR_DONT_RECURSE) got mbuf @ %x\n", m)); \
261 if (m) { \
262 (m)->m_type = (type); \
263 MBUFLOCK(mbstat.m_mtypes[type]++;) \
264 (m)->m_next = (struct mbuf *)NULL; \
265 (m)->m_nextpkt = (struct mbuf *)NULL; \
266 (m)->m_data = (m)->m_pktdat; \
267 (m)->m_flags = M_PKTHDR; \
268 } else \
269 (m) = (struct mbuf *)0; \
270 }
271 #endif /* OSKIT */
272
273 #ifndef OSKIT
274 /*
275 * Mbuf cluster macros.
276 * MCLALLOC(caddr_t p, int how) allocates an mbuf cluster.
277 * MCLGET adds such clusters to a normal mbuf;
278 * the flag M_EXT is set upon success.
279 * MCLFREE releases a reference to a cluster allocated by MCLALLOC,
280 * freeing the cluster if the reference count has reached 0.
281 *
282 * Normal mbuf clusters are normally treated as character arrays
283 * after allocation, but use the first word of the buffer as a free list
284 * pointer while on the free list.
285 */
286 union mcluster {
287 union mcluster *mcl_next;
288 char mcl_buf[MCLBYTES];
289 };
290
291 #define MCLALLOC(p, how) \
292 MBUFLOCK( \
293 OS_DbgPrint(OSK_MID_TRACE,("(MCLALLOC)\n")); \
294 if (mclfree == 0) \
295 (void)m_clalloc(1, (how)); \
296 (p) = (caddr_t)mclfree; \
297 if ((p)) { \
298 ++mclrefcnt[mtocl(p)]; \
299 mbstat.m_clfree--; \
300 mclfree = ((union mcluster *)(p))->mcl_next; \
301 } \
302 )
303
304 #ifdef __REACTOS__
305 #define MCLGET(m, how) { \
306 OS_DbgPrint(OSK_MID_TRACE,("(MCLGET) m = %x\n", m)); \
307 (m)->m_data = (m)->m_ext.ext_buf = malloc(MCLBYTES); \
308 (m)->m_flags |= M_EXT; \
309 (m)->m_ext.ext_size = MCLBYTES; \
310 }
311
312 #define MCLFREE(p) { \
313 free( (p) ); \
314 }
315 #else
316 #define MCLGET(m, how) \
317 { MCLALLOC((m)->m_ext.ext_buf, (how)); \
318 OS_DbgPrint(OSK_MID_TRACE,("(MCLGET) m = %x\n", m)); \
319 if ((m)->m_ext.ext_buf != NULL) { \
320 (m)->m_data = (m)->m_ext.ext_buf; \
321 (m)->m_flags |= M_EXT; \
322 (m)->m_ext.ext_size = MCLBYTES; \
323 } \
324 }
325
326 #define MCLFREE(p) \
327 MBUFLOCK ( \
328 OS_DbgPrint(OSK_MID_TRACE,("(MCLFREE)\n")); \
329 if (--mclrefcnt[mtocl(p)] == 0) { \
330 ((union mcluster *)(p))->mcl_next = mclfree; \
331 mclfree = (union mcluster *)(p); \
332 mbstat.m_clfree++; \
333 } \
334 )
335 #endif
336 #else
337 #define MCLGET(m, how) \
338 { (m)->m_ext.ext_bufio = oskit_bufio_create(MCLBYTES); \
339 OS_DbgPrint(OSK_MID_TRACE,("(!OSKIT MCLGET)\n")); \
340 oskit_bufio_map((m)->m_ext.ext_bufio, \
341 (void **)&((m)->m_ext.ext_buf), 0, MCLBYTES); \
342 if ((m)->m_ext.ext_buf != NULL) { \
343 (m)->m_data = (m)->m_ext.ext_buf; \
344 (m)->m_flags |= M_EXT; \
345 (m)->m_ext.ext_size = MCLBYTES; \
346 } \
347 }
348 #endif /* !OSKIT */
349
350 /*
351 * MFREE(struct mbuf *m, struct mbuf *n)
352 * Free a single mbuf and associated external storage.
353 * Place the successor, if any, in n.
354 */
355 #ifdef notyet
356 #define MFREE(m, n) \
357 { MBUFLOCK(mbstat.m_mtypes[(m)->m_type]--;) \
358 if ((m)->m_flags & M_EXT) { \
359 if ((m)->m_ext.ext_free) \
360 (*((m)->m_ext.ext_free))((m)->m_ext.ext_buf, \
361 (m)->m_ext.ext_size); \
362 else \
363 MCLFREE((m)->m_ext.ext_buf); \
364 } \
365 (n) = (m)->m_next; \
366 FREE((m), mbtypes[(m)->m_type]); \
367 m = NULL; \
368 }
369 #else /* notyet */
370 #ifdef OSKIT
371 #define MFREE(m, nn) \
372 { MBUFLOCK(mbstat.m_mtypes[(m)->m_type]--;) \
373 OS_DbgPrint(OSK_MID_TRACE,("(OSKIT MFREE) m = %x\n", m)); \
374 if ((m)->m_flags & M_EXT) { \
375 oskit_bufio_release((m)->m_ext.ext_bufio); \
376 } \
377 (nn) = (m)->m_next; \
378 FREE((m), mbtypes[(m)->m_type]); \
379 m = NULL; \
380 }
381 #else /* !OSKIT */
382 #define MFREE(m, nn) \
383 { MBUFLOCK(mbstat.m_mtypes[(m)->m_type]--;) \
384 OS_DbgPrint(OSK_MID_TRACE,("(!OSKIT MFREE) m = %x\n", m)); \
385 if ((m)->m_flags & M_EXT) { \
386 MCLFREE((m)->m_ext.ext_buf); \
387 } \
388 (nn) = (m)->m_next; \
389 FREE((m), mbtypes[(m)->m_type]); \
390 m = NULL; \
391 }
392 #endif /* OSKIT */
393 #endif
394
395 /*
396 * Copy mbuf pkthdr from from to to.
397 * from must have M_PKTHDR set, and to must be empty.
398 */
399 #define M_COPY_PKTHDR(to, from) { \
400 OS_DbgPrint(OSK_MID_TRACE,("(M_COPY_PKTHDR) to %x from %x\n", to, from)); \
401 (to)->m_pkthdr = (from)->m_pkthdr; \
402 (to)->m_flags = (from)->m_flags & M_COPYFLAGS; \
403 (to)->m_data = (to)->m_pktdat; \
404 }
405
406 /*
407 * Set the m_data pointer of a newly-allocated mbuf (m_get/MGET) to place
408 * an object of the specified size at the end of the mbuf, longword aligned.
409 */
410 #define M_ALIGN(m, len) \
411 { \
412 OS_DbgPrint(OSK_MID_TRACE,("(M_ALIGN) %d @ %x\n", m, len)); \
413 (m)->m_data += (MLEN - (len)) &~ (sizeof(long) - 1); \
414 }
415 /*
416 * As above, for mbufs allocated with m_gethdr/MGETHDR
417 * or initialized by M_COPY_PKTHDR.
418 */
419 #define MH_ALIGN(m, len) \
420 { \
421 OS_DbgPrint(OSK_MID_TRACE,("(MH_ALIGN) %d @ %x\n", m, len)); \
422 (m)->m_data += (MHLEN - (len)) &~ (sizeof(long) - 1); \
423 }
424
425 /*
426 * Compute the amount of space available
427 * before the current start of data in an mbuf.
428 */
429 #ifdef OSKIT
430 /* Be bold and strong: why shouldn't that work??? */
431 #define M_LEADINGSPACE(m) \
432 ((m)->m_flags & M_EXT ? (m)->m_data - (m)->m_ext.ext_buf : \
433 (m)->m_flags & M_PKTHDR ? (m)->m_data - (m)->m_pktdat : \
434 (m)->m_data - (m)->m_dat)
435 #else
436 #define M_LEADINGSPACE(m) \
437 ((m)->m_flags & M_EXT ? /* (m)->m_data - (m)->m_ext.ext_buf */ 0 : \
438 (m)->m_flags & M_PKTHDR ? (m)->m_data - (m)->m_pktdat : \
439 (m)->m_data - (m)->m_dat)
440 #endif /* OSKIT */
441
442 /*
443 * Compute the amount of space available
444 * after the end of data in an mbuf.
445 */
446 #define M_TRAILINGSPACE(m) \
447 OS_DbgPrint(OSK_MID_TRACE,("(M_TRAILINGSPACE) %x\n", m)); \
448 ((m)->m_flags & M_EXT ? (m)->m_ext.ext_buf + (m)->m_ext.ext_size - \
449 ((m)->m_data + (m)->m_len) : \
450 &(m)->m_dat[MLEN] - ((m)->m_data + (m)->m_len))
451
452 /*
453 * Arrange to prepend space of size plen to mbuf m.
454 * If a new mbuf must be allocated, how specifies whether to wait.
455 * If how is M_DONTWAIT and allocation fails, the original mbuf chain
456 * is freed and m is set to NULL.
457 */
458 #define M_PREPEND(m, plen, how) { \
459 OS_DbgPrint(OSK_MID_TRACE,("(M_PREPEND) %d on %x\n", plen, m)); \
460 if (M_LEADINGSPACE(m) >= (plen)) { \
461 (m)->m_data -= (plen); \
462 (m)->m_len += (plen); \
463 } else \
464 (m) = m_prepend((m), (plen), (how)); \
465 if ((m) && (m)->m_flags & M_PKTHDR) \
466 (m)->m_pkthdr.len += (plen); \
467 }
468
469 /* change mbuf to new type */
470 #define MCHTYPE(m, t) { \
471 OS_DbgPrint(OSK_MID_TRACE,("(MCHTYPE) %x %x\n", m, t)); \
472 MBUFLOCK(mbstat.m_mtypes[(m)->m_type]--; mbstat.m_mtypes[t]++;) \
473 (m)->m_type = t;\
474 }
475
476 /* length to m_copy to copy all */
477 #define M_COPYALL 1000000000
478
479 /* compatiblity with 4.3 */
480 #define m_copy(m, o, l) m_copym((m), (o), (l), M_DONTWAIT)
481
482 /*
483 * Mbuf statistics.
484 */
485 struct mbstat {
486 u_long m_mbufs; /* mbufs obtained from page pool */
487 u_long m_clusters; /* clusters obtained from page pool */
488 u_long m_spare; /* spare field */
489 u_long m_clfree; /* free clusters */
490 u_long m_drops; /* times failed to find space */
491 u_long m_wait; /* times waited for space */
492 u_long m_drain; /* times drained protocols for space */
493 u_short m_mtypes[256]; /* type specific mbuf allocations */
494 };
495
496 #ifdef KERNEL
497 #ifndef OSKIT
498 extern struct mbuf *mbutl; /* virtual address of mclusters */
499 extern char *mclrefcnt; /* cluster reference counts */
500 #endif /* !OSKIT */
501 struct mbstat mbstat;
502 #ifndef OSKIT
503 extern int nmbclusters;
504 union mcluster *mclfree;
505 #endif /* !OSKIT */
506 int max_linkhdr; /* largest link-level header */
507 int max_protohdr; /* largest protocol header */
508 int max_hdr; /* largest link+protocol header */
509 int max_datalen; /* MHLEN - max_hdr */
510 extern int mbtypes[]; /* XXX */
511
512 int m_clalloc __P((int, int));
513 void m_copyback __P((struct mbuf *, int, int, caddr_t));
514 struct mbuf *m_retry __P((int, int));
515 struct mbuf *m_retryhdr __P((int, int));
516 void m_reclaim __P((void));
517 struct mbuf *m_get __P((int, int));
518 struct mbuf *m_gethdr __P((int, int));
519 struct mbuf *m_getclr __P((int, int));
520 struct mbuf *m_free __P((struct mbuf *));
521 void m_freem __P((struct mbuf *));
522 struct mbuf *m_prepend __P((struct mbuf *,int,int));
523 struct mbuf *m_copym __P((struct mbuf *, int, int, int));
524 void m_copydata __P((struct mbuf *,int,int,caddr_t));
525 void m_cat __P((struct mbuf *,struct mbuf *));
526 void m_adj __P((struct mbuf *,int));
527 struct mbuf *m_pullup __P((struct mbuf *, int));
528 struct mbuf *m_split __P((struct mbuf *,int,int));
529 struct mbuf *m_devget __P((char *, int, int, struct ifnet *,
530 void (*copy)(struct mbuf *, caddr_t, u_int)));
531
532 #ifdef MBTYPES
533 int mbtypes[] = { /* XXX */
534 M_FREE, /* MT_FREE 0 should be on free list */
535 M_MBUF, /* MT_DATA 1 dynamic (data) allocation */
536 M_MBUF, /* MT_HEADER 2 packet header */
537 M_SOCKET, /* MT_SOCKET 3 socket structure */
538 M_PCB, /* MT_PCB 4 protocol control block */
539 M_RTABLE, /* MT_RTABLE 5 routing tables */
540 M_HTABLE, /* MT_HTABLE 6 IMP host tables */
541 0, /* MT_ATABLE 7 address resolution tables */
542 M_MBUF, /* MT_SONAME 8 socket name */
543 0, /* 9 */
544 M_SOOPTS, /* MT_SOOPTS 10 socket options */
545 M_FTABLE, /* MT_FTABLE 11 fragment reassembly header */
546 M_MBUF, /* MT_RIGHTS 12 access rights */
547 M_IFADDR, /* MT_IFADDR 13 interface address */
548 M_MBUF, /* MT_CONTROL 14 extra-data protocol message */
549 M_MBUF, /* MT_OOBDATA 15 expedited data */
550 #ifdef DATAKIT
551 25, 26, 27, 28, 29, 30, 31, 32 /* datakit ugliness */
552 #endif
553 };
554 #endif
555 #endif
556
557 #ifdef LOCAL_OSKIT_DEFINED
558 #undef LOCAL_OSKIT_DEFINED
559 #undef OSKIT
560 #endif
561
562 #endif /* !_SYS_MBUF_H_ */