Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 14 Jun 2004 10:19:20 -0700 (PDT)
From:      Julian Elischer <julian@elischer.org>
To:        James Housley <jim@Thehousleys.net>
Cc:        freebsd-net@FreeBSD.org
Subject:   Re: Using netgraph for filtering/modifing packets
Message-ID:  <Pine.BSF.4.21.0406141016280.30464-100000@InterJet.elischer.org>
In-Reply-To: <40CDBAC2.50403@Thehousleys.net>

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


On Mon, 14 Jun 2004, James Housley wrote:

> For testing of a product I would like to be able to modify or even drop
> packets based on their content.  What I have in mind is forcing the
> packets through a firewall that would redirect all packet to a netgraph
> node that would either pass unchanged, drop or change the contents to
> assist in testing some corner cases in the code.
> 
> 1) is this something doable with netgraph, I believe it is.

yes


> 
> 2) what might be a good place to start?  Have done some searching, but
> haven't found any example code I thought I could start from.

What sort of filter do you need?

you can pass packets to netgraph from ipfw by diverting them and
openning a divert socket with teh ksocket node..

Or you can pick them directly from the network interface
and filter yourself using the 'bpf' node type to select 
on something.
or you can use the etf type of node to filter on a particular 
ethertype..

there are a lot of options but I don't knw your application enough :-)

Julian


> 
> Thanks,
> Jim
> 
> -- 
> /"\   ASCII Ribbon Campaign  .
> \ / - NO HTML/RTF in e-mail  .
>    X  - NO Word docs in e-mail .
> / \ -----------------------------------------------------------------
> jeh@FreeBSD.org      http://www.FreeBSD.org     The Power to Serve
> jim@TheHousleys.Net  http://www.TheHousleys.net
> ---------------------------------------------------------------------
> Your mouse has moved.
> Windows NT must be restarted for the change to take effect!
> 
> Reboot now?  [OK]
> 



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