Deleted Added
full compact
ng_iface.c (191510) ng_iface.c (194012)
1/*
2 * ng_iface.c
3 */
4
5/*-
6 * Copyright (c) 1996-1999 Whistle Communications, Inc.
7 * All rights reserved.
8 *

--- 23 unchanged lines hidden (view full) ---

32 * SERVICES, LOSS OF USE, DATA OR PROFITS, HOWEVER CAUSED AND UNDER ANY
33 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
34 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
35 * THIS SOFTWARE, EVEN IF WHISTLE COMMUNICATIONS IS ADVISED OF THE POSSIBILITY
36 * OF SUCH DAMAGE.
37 *
38 * Author: Archie Cobbs <archie@freebsd.org>
39 *
1/*
2 * ng_iface.c
3 */
4
5/*-
6 * Copyright (c) 1996-1999 Whistle Communications, Inc.
7 * All rights reserved.
8 *

--- 23 unchanged lines hidden (view full) ---

32 * SERVICES, LOSS OF USE, DATA OR PROFITS, HOWEVER CAUSED AND UNDER ANY
33 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
34 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
35 * THIS SOFTWARE, EVEN IF WHISTLE COMMUNICATIONS IS ADVISED OF THE POSSIBILITY
36 * OF SUCH DAMAGE.
37 *
38 * Author: Archie Cobbs <archie@freebsd.org>
39 *
40 * $FreeBSD: head/sys/netgraph/ng_iface.c 191510 2009-04-26 07:14:50Z zec $
40 * $FreeBSD: head/sys/netgraph/ng_iface.c 194012 2009-06-11 16:50:49Z zec $
41 * $Whistle: ng_iface.c,v 1.33 1999/11/01 09:24:51 julian Exp $
42 */
43
44/*
45 * This node is also a system networking interface. It has
46 * a hook for each protocol (IP, AppleTalk, IPX, etc). Packets
47 * are simply relayed between the interface and the hooks.
48 *

--- 428 unchanged lines hidden (view full) ---

477 m_freem(m);
478 log(LOG_WARNING, "%s: can't handle af%d\n", ifp->if_xname, sa);
479 return (EAFNOSUPPORT);
480 }
481
482 /* Copy length before the mbuf gets invalidated. */
483 len = m->m_pkthdr.len;
484
41 * $Whistle: ng_iface.c,v 1.33 1999/11/01 09:24:51 julian Exp $
42 */
43
44/*
45 * This node is also a system networking interface. It has
46 * a hook for each protocol (IP, AppleTalk, IPX, etc). Packets
47 * are simply relayed between the interface and the hooks.
48 *

--- 428 unchanged lines hidden (view full) ---

477 m_freem(m);
478 log(LOG_WARNING, "%s: can't handle af%d\n", ifp->if_xname, sa);
479 return (EAFNOSUPPORT);
480 }
481
482 /* Copy length before the mbuf gets invalidated. */
483 len = m->m_pkthdr.len;
484
485 /* Send packet. If hook is not connected,
486 mbuf will get freed. */
485 /* Send packet. If hook is not connected, mbuf will get freed. */
486 NG_OUTBOUND_THREAD_REF();
487 NG_SEND_DATA_ONLY(error, *get_hook_from_iffam(priv, iffam), m);
487 NG_SEND_DATA_ONLY(error, *get_hook_from_iffam(priv, iffam), m);
488 NG_OUTBOUND_THREAD_UNREF();
488
489 /* Update stats. */
490 if (error == 0) {
491 ifp->if_obytes += len;
492 ifp->if_opackets++;
493 }
494
495 return (error);

--- 109 unchanged lines hidden (view full) ---

605
606 if (iffam == NULL)
607 return (EPFNOSUPPORT);
608 hookptr = get_hook_from_iffam(NG_NODE_PRIVATE(node), iffam);
609 if (*hookptr != NULL)
610 return (EISCONN);
611 *hookptr = hook;
612 NG_HOOK_HI_STACK(hook);
489
490 /* Update stats. */
491 if (error == 0) {
492 ifp->if_obytes += len;
493 ifp->if_opackets++;
494 }
495
496 return (error);

--- 109 unchanged lines hidden (view full) ---

606
607 if (iffam == NULL)
608 return (EPFNOSUPPORT);
609 hookptr = get_hook_from_iffam(NG_NODE_PRIVATE(node), iffam);
610 if (*hookptr != NULL)
611 return (EISCONN);
612 *hookptr = hook;
613 NG_HOOK_HI_STACK(hook);
614 NG_HOOK_SET_TO_INBOUND(hook);
613 return (0);
614}
615
616/*
617 * Receive a control message
618 */
619static int
620ng_iface_rcvmsg(node_p node, item_p item, hook_p lasthook)

--- 268 unchanged lines hidden ---
615 return (0);
616}
617
618/*
619 * Receive a control message
620 */
621static int
622ng_iface_rcvmsg(node_p node, item_p item, hook_p lasthook)

--- 268 unchanged lines hidden ---