Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 26 Feb 2003 12:05:15 -0800 (PST)
From:      Julian Elischer <julian@elischer.org>
To:        Bill Paul <wpaul@FreeBSD.ORG>
Cc:        src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org
Subject:   Re: cvs commit: src/sys/netgraph ng_fec.c
Message-ID:  <Pine.BSF.4.21.0302261203581.88133-100000@InterJet.elischer.org>
In-Reply-To: <20030226200028.2584D37B401@hub.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help


On Wed, 26 Feb 2003, Bill Paul wrote:

> > 
> > On Tue, 25 Feb 2003, Bill Paul wrote:
> > 
> > > wpaul       2003/02/25 22:38:54 PST
> > > 
> > >   Modified files:
> > >     sys/netgraph         ng_fec.c 
> > >   Log:
> > >   Attempt to make the ng_fec module play nice with BPF again. Things have
> > >   changed since this code was written:
> > >   
> > >   - The ng_ether_input_p hook only accepts two arguments now: the pointer
> > >     to the ether header structure is gone.
> > 
> > The problem is that you should not be using ng_ether_input_p at all
> > that is a private interface between ng_ether.c and if_ethersubr.c.
> > You should be connecting a hook to ng_ether.c which will in turn
> > use ng_ether_input_p.
> 
> [...]
> 
> Actually, there's a better (IMO) way. When I originally wrote this module,
> I ended up using some netgraph features for two reasons: 1) using ngctl
> saved me from having to write a separate feccontrol utility or mangling
> ifconfig(8) to handle bundle configuration, and 2) I needed a way to snag
> incoming frames. The ng_ether_input_p hook let me do that without having
> to modify if_ethersubr.c myself, which I wanted to avoid. What I _really_
> wanted to do was grab packets from the interfaces directly, before they
> went into ether_input(), but I couldn't do that then.
> 
> I can, however, do it now. In 5.x, drivers call ifp->if_input rather than
> using ether_input() directly, which makes it very simple to snarf frames
> from them and massage them a bit before passing them on. I decided to
> change ng_fec to work this way. As far as I'm concerned, it's a much
> cleaner solution, and it avoids the collison with ng_ether.

Great..

This makes ng_fec.c a netgraph node in name only.. :-)
it just uses the netgraph infrastructure for control messages and for
module loadabilty.


> 
> -Bill
> 
> --
> =============================================================================
> -Bill Paul            (510) 749-2329 | Senior Engineer, Master of Unix-Fu
>                  wpaul@windriver.com | Wind River Systems
> =============================================================================
>       "If stupidity were a handicap, you'd have the best parking spot."
> =============================================================================
> 


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-src" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.21.0302261203581.88133-100000>