mbuf.h (105530) | mbuf.h (108466) |
---|---|
1/*- 2 * Copyright (c) 1982, 1986, 1988, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 17 unchanged lines hidden (view full) --- 26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * SUCH DAMAGE. 32 * 33 * @(#)mbuf.h 8.5 (Berkeley) 2/19/95 | 1/*- 2 * Copyright (c) 1982, 1986, 1988, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 17 unchanged lines hidden (view full) --- 26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * SUCH DAMAGE. 32 * 33 * @(#)mbuf.h 8.5 (Berkeley) 2/19/95 |
34 * $FreeBSD: head/sys/sys/mbuf.h 105530 2002-10-20 16:55:52Z phk $ | 34 * $FreeBSD: head/sys/sys/mbuf.h 108466 2002-12-30 20:22:40Z sam $ |
35 */ 36 37#ifndef _SYS_MBUF_H_ 38#define _SYS_MBUF_H_ 39 40#include <sys/_label.h> 41#include <sys/queue.h> 42 --- 129 unchanged lines hidden (view full) --- 172#define EXT_SFBUF 2 /* sendfile(2)'s sf_bufs */ 173#define EXT_NET_DRV 100 /* custom ext_buf provided by net driver(s) */ 174#define EXT_MOD_TYPE 200 /* custom module's ext_buf type */ 175#define EXT_DISPOSABLE 300 /* can throw this buffer away w/page flipping */ 176 177/* 178 * Flags copied when copying m_pkthdr. 179 */ | 35 */ 36 37#ifndef _SYS_MBUF_H_ 38#define _SYS_MBUF_H_ 39 40#include <sys/_label.h> 41#include <sys/queue.h> 42 --- 129 unchanged lines hidden (view full) --- 172#define EXT_SFBUF 2 /* sendfile(2)'s sf_bufs */ 173#define EXT_NET_DRV 100 /* custom ext_buf provided by net driver(s) */ 174#define EXT_MOD_TYPE 200 /* custom module's ext_buf type */ 175#define EXT_DISPOSABLE 300 /* can throw this buffer away w/page flipping */ 176 177/* 178 * Flags copied when copying m_pkthdr. 179 */ |
180#define M_COPYFLAGS (M_PKTHDR|M_EOR|M_PROTO1|M_PROTO1|M_PROTO2|M_PROTO3 | \ 181 M_PROTO4|M_PROTO5|M_BCAST|M_MCAST|M_FRAG|M_RDONLY) | 180#define M_COPYFLAGS (M_PKTHDR|M_EOR|M_RDONLY|M_PROTO1|M_PROTO1|M_PROTO2|\ 181 M_PROTO3|M_PROTO4|M_PROTO5|M_BCAST|M_MCAST|\ 182 M_FRAG|M_FIRSTFRAG|M_LASTFRAG) |
182 183/* 184 * Flags indicating hw checksum support and sw checksum requirements. 185 */ 186#define CSUM_IP 0x0001 /* will csum IP */ 187#define CSUM_TCP 0x0002 /* will csum TCP */ 188#define CSUM_UDP 0x0004 /* will csum UDP */ 189#define CSUM_IP_FRAGS 0x0008 /* will csum IP fragments */ --- 99 unchanged lines hidden (view full) --- 289} while(0) 290 291#define MEXT_ADD_REF(m) atomic_add_int((m)->m_ext.ref_cnt, 1) 292 293/* 294 * mbuf, cluster, and external object allocation macros 295 * (for compatibility purposes). 296 */ | 183 184/* 185 * Flags indicating hw checksum support and sw checksum requirements. 186 */ 187#define CSUM_IP 0x0001 /* will csum IP */ 188#define CSUM_TCP 0x0002 /* will csum TCP */ 189#define CSUM_UDP 0x0004 /* will csum UDP */ 190#define CSUM_IP_FRAGS 0x0008 /* will csum IP fragments */ --- 99 unchanged lines hidden (view full) --- 290} while(0) 291 292#define MEXT_ADD_REF(m) atomic_add_int((m)->m_ext.ref_cnt, 1) 293 294/* 295 * mbuf, cluster, and external object allocation macros 296 * (for compatibility purposes). 297 */ |
297#define M_COPY_PKTHDR(to, from) m_copy_pkthdr((to), (from)) | 298/* NB: M_COPY_PKTHDR is deprecated, use M_MOVE_PKTHDR or m_dup_pktdr */ 299#define M_MOVE_PKTHDR(to, from) m_move_pkthdr((to), (from)) |
298#define m_getclr(how, type) m_get_clrd((how), (type)) 299#define MGET(m, how, type) ((m) = m_get((how), (type))) 300#define MGETHDR(m, how, type) ((m) = m_gethdr((how), (type))) 301#define MCLGET(m, how) m_clget((m), (how)) 302#define MEXTADD(m, buf, size, free, args, flags, type) \ 303 m_extadd((m), (caddr_t)(buf), (size), (free), (args), (flags), (type)) 304 305/* --- 117 unchanged lines hidden (view full) --- 423void m_copyback(struct mbuf *, int, int, caddr_t); 424void m_copydata(const struct mbuf *, int, int, caddr_t); 425struct mbuf *m_copym(struct mbuf *, int, int, int); 426struct mbuf *m_copypacket(struct mbuf *, int); 427void m_copy_pkthdr(struct mbuf *, struct mbuf *); 428struct mbuf *m_devget(char *, int, int, struct ifnet *, 429 void (*)(char *, caddr_t, u_int)); 430struct mbuf *m_dup(struct mbuf *, int); | 300#define m_getclr(how, type) m_get_clrd((how), (type)) 301#define MGET(m, how, type) ((m) = m_get((how), (type))) 302#define MGETHDR(m, how, type) ((m) = m_gethdr((how), (type))) 303#define MCLGET(m, how) m_clget((m), (how)) 304#define MEXTADD(m, buf, size, free, args, flags, type) \ 305 m_extadd((m), (caddr_t)(buf), (size), (free), (args), (flags), (type)) 306 307/* --- 117 unchanged lines hidden (view full) --- 425void m_copyback(struct mbuf *, int, int, caddr_t); 426void m_copydata(const struct mbuf *, int, int, caddr_t); 427struct mbuf *m_copym(struct mbuf *, int, int, int); 428struct mbuf *m_copypacket(struct mbuf *, int); 429void m_copy_pkthdr(struct mbuf *, struct mbuf *); 430struct mbuf *m_devget(char *, int, int, struct ifnet *, 431 void (*)(char *, caddr_t, u_int)); 432struct mbuf *m_dup(struct mbuf *, int); |
433int m_dup_pkthdr(struct mbuf *, struct mbuf *, int); |
|
431u_int m_fixhdr(struct mbuf *); 432struct mbuf *m_free(struct mbuf *); 433void m_freem(struct mbuf *); 434struct mbuf *m_get(int, short); 435struct mbuf *m_get_clrd(int, short); 436struct mbuf *m_getcl(int, short, int); 437struct mbuf *m_gethdr(int, short); 438struct mbuf *m_gethdr_clrd(int, short); 439struct mbuf *m_getm(struct mbuf *, int, int, short); 440u_int m_length(struct mbuf *, struct mbuf **); | 434u_int m_fixhdr(struct mbuf *); 435struct mbuf *m_free(struct mbuf *); 436void m_freem(struct mbuf *); 437struct mbuf *m_get(int, short); 438struct mbuf *m_get_clrd(int, short); 439struct mbuf *m_getcl(int, short, int); 440struct mbuf *m_gethdr(int, short); 441struct mbuf *m_gethdr_clrd(int, short); 442struct mbuf *m_getm(struct mbuf *, int, int, short); 443u_int m_length(struct mbuf *, struct mbuf **); |
444void m_move_pkthdr(struct mbuf *, struct mbuf *); |
|
441struct mbuf *m_prepend(struct mbuf *, int, int); 442void m_print(const struct mbuf *); 443struct mbuf *m_pulldown(struct mbuf *, int, int, int *); 444struct mbuf *m_pullup(struct mbuf *, int); 445struct mbuf *m_split(struct mbuf *, int, int); 446 447/* 448 * Packets may have annotations attached by affixing a list --- 74 unchanged lines hidden (view full) --- 523/* Packet tag routines */ 524struct m_tag *m_tag_alloc(u_int32_t, int, int, int); 525void m_tag_free(struct m_tag *); 526void m_tag_prepend(struct mbuf *, struct m_tag *); 527void m_tag_unlink(struct mbuf *, struct m_tag *); 528void m_tag_delete(struct mbuf *, struct m_tag *); 529void m_tag_delete_chain(struct mbuf *, struct m_tag *); 530struct m_tag *m_tag_locate(struct mbuf *, u_int32_t, int, struct m_tag *); | 445struct mbuf *m_prepend(struct mbuf *, int, int); 446void m_print(const struct mbuf *); 447struct mbuf *m_pulldown(struct mbuf *, int, int, int *); 448struct mbuf *m_pullup(struct mbuf *, int); 449struct mbuf *m_split(struct mbuf *, int, int); 450 451/* 452 * Packets may have annotations attached by affixing a list --- 74 unchanged lines hidden (view full) --- 527/* Packet tag routines */ 528struct m_tag *m_tag_alloc(u_int32_t, int, int, int); 529void m_tag_free(struct m_tag *); 530void m_tag_prepend(struct mbuf *, struct m_tag *); 531void m_tag_unlink(struct mbuf *, struct m_tag *); 532void m_tag_delete(struct mbuf *, struct m_tag *); 533void m_tag_delete_chain(struct mbuf *, struct m_tag *); 534struct m_tag *m_tag_locate(struct mbuf *, u_int32_t, int, struct m_tag *); |
531struct m_tag *m_tag_copy(struct m_tag *); 532int m_tag_copy_chain(struct mbuf *, struct mbuf *); | 535struct m_tag *m_tag_copy(struct m_tag *, int); 536int m_tag_copy_chain(struct mbuf *, struct mbuf *, int); |
533void m_tag_init(struct mbuf *); 534struct m_tag *m_tag_first(struct mbuf *); 535struct m_tag *m_tag_next(struct mbuf *, struct m_tag *); 536 537/* these are for openbsd compatibility */ 538#define MTAG_ABI_COMPAT 0 /* compatibility ABI */ 539 540static __inline struct m_tag * --- 13 unchanged lines hidden --- | 537void m_tag_init(struct mbuf *); 538struct m_tag *m_tag_first(struct mbuf *); 539struct m_tag *m_tag_next(struct mbuf *, struct m_tag *); 540 541/* these are for openbsd compatibility */ 542#define MTAG_ABI_COMPAT 0 /* compatibility ABI */ 543 544static __inline struct m_tag * --- 13 unchanged lines hidden --- |