Deleted Added
full compact
1/* $FreeBSD: head/sys/netinet/ip_encap.c 95023 2002-04-19 04:46:24Z suz $ */
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#if 0
489 m->m_pkthdr.aux = ep->arg;
490#else
491 struct mbuf *n;
492
493 n = m_aux_add(m, AF_INET, IPPROTO_IPV4);
494 if (n) {
495 *mtod(n, void **) = ep->arg;
496 n->m_len = sizeof(void *);
497 }
498#endif
499}
500
501void *
502encap_getarg(m)
503 struct mbuf *m;
504{
505 void *p;
506#if 0
507 p = m->m_pkthdr.aux;
508 m->m_pkthdr.aux = NULL;
509 return p;
510#else
511 struct mbuf *n;
512
513 p = NULL;
514 n = m_aux_find(m, AF_INET, IPPROTO_IPV4);
515 if (n) {
516 if (n->m_len == sizeof(void *))
517 p = *mtod(n, void **);
518 m_aux_delete(m, n);
519 }
520 return p;
521#endif
522}