1/*
2 * ng_gif_demux.c
3 *
4 * Copyright 2001 The Aerospace Corporation. All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:
--- 46 unchanged lines hidden (view full) ---
55 * WITHOUT LIMITATION, ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
56 * PUNITIVE, OR CONSEQUENTIAL DAMAGES, PROCUREMENT OF SUBSTITUTE GOODS OR
57 * SERVICES, LOSS OF USE, DATA OR PROFITS, HOWEVER CAUSED AND UNDER ANY
58 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
59 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
60 * THIS SOFTWARE, EVEN IF WHISTLE COMMUNICATIONS IS ADVISED OF THE POSSIBILITY
61 * OF SUCH DAMAGE.
62 *
63 * $FreeBSD: head/sys/netgraph/ng_gif_demux.c 109623 2003-01-21 08:56:16Z alfred $
64 */
65
66/*
67 * ng_gif_demux(4) netgraph node type
68 *
69 * Packets received on the "gif" hook have their type header removed
70 * and are passed to the appropriate hook protocol hook. Packets
71 * recieved on a protocol hook have a type header added back and are
--- 269 unchanged lines hidden (view full) ---
341 }
342 outhook = *get_hook_from_iffam(priv, iffam);
343 m_adj(m, sizeof(sa_family_t));
344 } else {
345 /*
346 * Add address family header and set the output hook.
347 */
348 iffam = get_iffam_from_hook(priv, hook);
349 M_PREPEND(m, sizeof (iffam->family), M_NOWAIT);
350 if (m == NULL) {
351 NG_FREE_M(m);
352 NG_FREE_ITEM(item);
353 return (ENOBUFS);
354 }
355 bcopy(&iffam->family, mtod(m, sa_family_t *),
356 sizeof(iffam->family));
357 outhook = priv->gif;
--- 44 unchanged lines hidden ---
2 * ng_gif_demux.c
3 *
4 * Copyright 2001 The Aerospace Corporation. All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:
--- 46 unchanged lines hidden (view full) ---
55 * WITHOUT LIMITATION, ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
56 * PUNITIVE, OR CONSEQUENTIAL DAMAGES, PROCUREMENT OF SUBSTITUTE GOODS OR
57 * SERVICES, LOSS OF USE, DATA OR PROFITS, HOWEVER CAUSED AND UNDER ANY
58 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
59 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
60 * THIS SOFTWARE, EVEN IF WHISTLE COMMUNICATIONS IS ADVISED OF THE POSSIBILITY
61 * OF SUCH DAMAGE.
62 *
63 * $FreeBSD: head/sys/netgraph/ng_gif_demux.c 109623 2003-01-21 08:56:16Z alfred $
64 */
65
66/*
67 * ng_gif_demux(4) netgraph node type
68 *
69 * Packets received on the "gif" hook have their type header removed
70 * and are passed to the appropriate hook protocol hook. Packets
71 * recieved on a protocol hook have a type header added back and are
--- 269 unchanged lines hidden (view full) ---
341 }
342 outhook = *get_hook_from_iffam(priv, iffam);
343 m_adj(m, sizeof(sa_family_t));
344 } else {
345 /*
346 * Add address family header and set the output hook.
347 */
348 iffam = get_iffam_from_hook(priv, hook);
349 M_PREPEND(m, sizeof (iffam->family), M_NOWAIT);
350 if (m == NULL) {
351 NG_FREE_M(m);
352 NG_FREE_ITEM(item);
353 return (ENOBUFS);
354 }
355 bcopy(&iffam->family, mtod(m, sa_family_t *),
356 sizeof(iffam->family));
357 outhook = priv->gif;
--- 44 unchanged lines hidden ---