Subject: Re: Capturing/Modifying TCP packets when used as a router.
To: Hemant Puri <hemant@neoscale.com>
From: Darren Reed <darrenr@reed.wattle.id.au>
List: tech-net
Date: 11/28/2001 20:26:25
In some email I received from Hemant Puri, sie wrote:
[Charset iso-8859-1 unsupported, filtering to ASCII...]
> Hi,
> 
>   Checked up the 'pfil' man page. Man page says that one can register a
> function for incoming and outgoing packets.
> 
> func(void *data, int hlen, struct ifnet *net, int dir, struct mbuf **m)
> 
> where
> data is the ip data.
> 
> 
> Now the question is can I just see the contents only or I can modify it
> also. 
> 
> It seems that I cannot modify it since there is now way to return the
> modified length. Am I missing something?

You don't need to return the modified length.  You may modify the contents
but you are expected to return everything all in network byte order, where
this is of concern.

Darren