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

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

30 * SERVICES, LOSS OF USE, DATA OR PROFITS, HOWEVER CAUSED AND UNDER ANY
31 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
32 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
33 * THIS SOFTWARE, EVEN IF WHISTLE COMMUNICATIONS IS ADVISED OF THE POSSIBILITY
34 * OF SUCH DAMAGE.
35 *
36 * Author: Archie Cobbs <archie@freebsd.org>
37 *
1/*
2 * ng_iface.c
3 *
4 * Copyright (c) 1996-1999 Whistle Communications, Inc.
5 * All rights reserved.
6 *
7 * Subject to the following obligations and disclaimer of warranty, use and
8 * redistribution of this software, in source or object code forms, with or

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

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

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

480
481/*
482 * Flash a packet by the BPF (requires prepending 4 byte AF header)
483 * Note the phoney mbuf; this is OK because BPF treats it read-only.
484 */
485static void
486ng_iface_bpftap(struct ifnet *ifp, struct mbuf *m, sa_family_t family)
487{
39 * $Whistle: ng_iface.c,v 1.33 1999/11/01 09:24:51 julian Exp $
40 */
41
42/*
43 * This node is also a system networking interface. It has
44 * a hook for each protocol (IP, AppleTalk, IPX, etc). Packets
45 * are simply relayed between the interface and the hooks.
46 *

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

480
481/*
482 * Flash a packet by the BPF (requires prepending 4 byte AF header)
483 * Note the phoney mbuf; this is OK because BPF treats it read-only.
484 */
485static void
486ng_iface_bpftap(struct ifnet *ifp, struct mbuf *m, sa_family_t family)
487{
488 int32_t family4 = (int32_t)family;
489 struct mbuf m0;
490
491 KASSERT(family != AF_UNSPEC, ("%s: family=AF_UNSPEC", __func__));
492 if (ifp->if_bpf != NULL) {
488 KASSERT(family != AF_UNSPEC, ("%s: family=AF_UNSPEC", __func__));
489 if (ifp->if_bpf != NULL) {
493 bzero(&m0, sizeof(m0));
494 m0.m_next = m;
495 m0.m_len = sizeof(family4);
496 m0.m_data = (char *)&family4;
497 BPF_MTAP(ifp, &m0);
490 int32_t family4 = (int32_t)family;
491 bpf_mtap2(ifp->if_bpf, &family4, sizeof(family4), m);
498 }
499}
500
501#ifdef DEBUG
502/*
503 * Display an ioctl to the virtual interface
504 */
505

--- 321 unchanged lines hidden ---
492 }
493}
494
495#ifdef DEBUG
496/*
497 * Display an ioctl to the virtual interface
498 */
499

--- 321 unchanged lines hidden ---