1/* $FreeBSD: head/sys/netinet/ip_encap.c 105194 2002-10-16 01:54:46Z sam $ */ |
2/* $KAME: ip_encap.c,v 1.41 2001/03/15 08:35:08 itojun Exp $ */ 3 4/* 5 * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. 6 * All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without 9 * modification, are permitted provided that the following conditions --- 470 unchanged lines hidden (view full) --- 480 return 0; 481} 482 483static void 484encap_fillarg(m, ep) 485 struct mbuf *m; 486 const struct encaptab *ep; 487{ |
488 struct m_tag *tag; |
489 |
490 tag = m_tag_get(PACKET_TAG_ENCAP, sizeof (void*), M_NOWAIT); 491 if (tag) { 492 *(void**)(tag+1) = ep->arg; 493 m_tag_prepend(m, tag); |
494 } |
495} 496 497void * 498encap_getarg(m) 499 struct mbuf *m; 500{ |
501 void *p = NULL; 502 struct m_tag *tag; |
503 |
504 tag = m_tag_find(m, PACKET_TAG_ENCAP, NULL); 505 if (tag) { 506 p = *(void**)(tag+1); 507 m_tag_delete(m, tag); |
508 } 509 return p; |
510} |