Deleted Added
sdiff udiff text old ( 106933 ) new ( 111888 )
full compact
1
2/*
3 * ng_iface.c
4 *
5 * Copyright (c) 1996-1999 Whistle Communications, Inc.
6 * All rights reserved.
7 *
8 * Subject to the following obligations and disclaimer of warranty, use and
9 * redistribution of this software, in source or object code forms, with or

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

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

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

53
54#include <sys/param.h>
55#include <sys/systm.h>
56#include <sys/errno.h>
57#include <sys/kernel.h>
58#include <sys/malloc.h>
59#include <sys/mbuf.h>
60#include <sys/errno.h>
61#include <sys/sockio.h>
62#include <sys/socket.h>
63#include <sys/syslog.h>
64#include <sys/libkern.h>
65
66#include <net/if.h>
67#include <net/if_types.h>
68#include <net/intrq.h>
69#include <net/bpf.h>
70
71#include <netinet/in.h>
72
73#include <netgraph/ng_message.h>
74#include <netgraph/netgraph.h>
75#include <netgraph/ng_parse.h>
76#include <netgraph/ng_iface.h>
77#include <netgraph/ng_cisco.h>

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

724 */
725static int
726ng_iface_rcvdata(hook_p hook, item_p item)
727{
728 const priv_p priv = NG_NODE_PRIVATE(NG_HOOK_NODE(hook));
729 const iffam_p iffam = get_iffam_from_hook(priv, hook);
730 struct ifnet *const ifp = priv->ifp;
731 struct mbuf *m;
732
733 NGI_GET_M(item, m);
734 NG_FREE_ITEM(item);
735 /* Sanity checks */
736 KASSERT(iffam != NULL, ("%s: iffam", __func__));
737 KASSERT(m->m_flags & M_PKTHDR, ("%s: not pkthdr", __func__));
738 if (m == NULL)
739 return (EINVAL);

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

748
749 /* Note receiving interface */
750 m->m_pkthdr.rcvif = ifp;
751
752 /* Berkeley packet filter */
753 ng_iface_bpftap(ifp, m, iffam->family);
754
755 /* Send packet */
756 return family_enqueue(iffam->family, m);
757}
758
759/*
760 * Shutdown and remove the node and its associated interface.
761 */
762static int
763ng_iface_shutdown(node_p node)
764{

--- 29 unchanged lines hidden ---