uipc_mbuf2.c (193511) | uipc_mbuf2.c (209390) |
---|---|
1/* $KAME: uipc_mbuf2.c,v 1.31 2001/11/28 11:08:53 itojun Exp $ */ 2/* $NetBSD: uipc_mbuf.c,v 1.40 1999/04/01 00:23:25 thorpej Exp $ */ 3 4/*- 5 * Copyright (C) 1999 WIDE Project. 6 * All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 47 unchanged lines hidden (view full) --- 56 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 57 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 58 * SUCH DAMAGE. 59 * 60 * @(#)uipc_mbuf.c 8.4 (Berkeley) 2/14/95 61 */ 62 63#include <sys/cdefs.h> | 1/* $KAME: uipc_mbuf2.c,v 1.31 2001/11/28 11:08:53 itojun Exp $ */ 2/* $NetBSD: uipc_mbuf.c,v 1.40 1999/04/01 00:23:25 thorpej Exp $ */ 3 4/*- 5 * Copyright (C) 1999 WIDE Project. 6 * All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 47 unchanged lines hidden (view full) --- 56 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 57 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 58 * SUCH DAMAGE. 59 * 60 * @(#)uipc_mbuf.c 8.4 (Berkeley) 2/14/95 61 */ 62 63#include <sys/cdefs.h> |
64__FBSDID("$FreeBSD: head/sys/kern/uipc_mbuf2.c 193511 2009-06-05 14:55:22Z rwatson $"); | 64__FBSDID("$FreeBSD: head/sys/kern/uipc_mbuf2.c 209390 2010-06-21 09:55:56Z ed $"); |
65 66/*#define PULLDOWN_DEBUG*/ 67 68#include <sys/param.h> 69#include <sys/systm.h> 70#include <sys/kernel.h> 71#include <sys/lock.h> 72#include <sys/malloc.h> --- 236 unchanged lines hidden (view full) --- 309 if (t->m_tag_id == PACKET_TAG_MACLABEL) 310 mac_mbuf_tag_destroy(t); 311#endif 312 free(t, M_PACKET_TAGS); 313} 314 315/* Get a packet tag structure along with specified data following. */ 316struct m_tag * | 65 66/*#define PULLDOWN_DEBUG*/ 67 68#include <sys/param.h> 69#include <sys/systm.h> 70#include <sys/kernel.h> 71#include <sys/lock.h> 72#include <sys/malloc.h> --- 236 unchanged lines hidden (view full) --- 309 if (t->m_tag_id == PACKET_TAG_MACLABEL) 310 mac_mbuf_tag_destroy(t); 311#endif 312 free(t, M_PACKET_TAGS); 313} 314 315/* Get a packet tag structure along with specified data following. */ 316struct m_tag * |
317m_tag_alloc(u_int32_t cookie, int type, int len, int wait) | 317m_tag_alloc(uint32_t cookie, int type, int len, int wait) |
318{ 319 struct m_tag *t; 320 321 MBUF_CHECKSLEEP(wait); 322 if (len < 0) 323 return NULL; 324 t = malloc(len + sizeof(struct m_tag), M_PACKET_TAGS, wait); 325 if (t == NULL) --- 45 unchanged lines hidden (view full) --- 371 372 SLIST_FOREACH_SAFE(p, &m->m_pkthdr.tags, m_tag_link, q) 373 if ((p->m_tag_id & MTAG_PERSISTENT) == 0) 374 m_tag_delete(m, p); 375} 376 377/* Find a tag, starting from a given position. */ 378struct m_tag * | 318{ 319 struct m_tag *t; 320 321 MBUF_CHECKSLEEP(wait); 322 if (len < 0) 323 return NULL; 324 t = malloc(len + sizeof(struct m_tag), M_PACKET_TAGS, wait); 325 if (t == NULL) --- 45 unchanged lines hidden (view full) --- 371 372 SLIST_FOREACH_SAFE(p, &m->m_pkthdr.tags, m_tag_link, q) 373 if ((p->m_tag_id & MTAG_PERSISTENT) == 0) 374 m_tag_delete(m, p); 375} 376 377/* Find a tag, starting from a given position. */ 378struct m_tag * |
379m_tag_locate(struct mbuf *m, u_int32_t cookie, int type, struct m_tag *t) | 379m_tag_locate(struct mbuf *m, uint32_t cookie, int type, struct m_tag *t) |
380{ 381 struct m_tag *p; 382 383 KASSERT(m, ("m_tag_locate: null mbuf")); 384 if (t == NULL) 385 p = SLIST_FIRST(&m->m_pkthdr.tags); 386 else 387 p = SLIST_NEXT(t, m_tag_link); --- 66 unchanged lines hidden --- | 380{ 381 struct m_tag *p; 382 383 KASSERT(m, ("m_tag_locate: null mbuf")); 384 if (t == NULL) 385 p = SLIST_FIRST(&m->m_pkthdr.tags); 386 else 387 p = SLIST_NEXT(t, m_tag_link); --- 66 unchanged lines hidden --- |