From owner-freebsd-net@FreeBSD.ORG Sun Aug 26 23:55:57 2007 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DC87E16A419 for ; Sun, 26 Aug 2007 23:55:57 +0000 (UTC) (envelope-from freebsd@meijome.net) Received: from sigma.octantis.com.au (ns2.octantis.com.au [207.44.189.124]) by mx1.freebsd.org (Postfix) with ESMTP id 914A713C442 for ; Sun, 26 Aug 2007 23:55:57 +0000 (UTC) (envelope-from freebsd@meijome.net) Received: (qmail 14732 invoked from network); 26 Aug 2007 18:55:55 -0500 Received: from 124-170-104-118.dyn.iinet.net.au (HELO localhost) (124.170.104.118) by sigma.octantis.com.au with (DHE-RSA-AES256-SHA encrypted) SMTP; 26 Aug 2007 18:55:54 -0500 Date: Mon, 27 Aug 2007 09:55:50 +1000 From: Norberto Meijome To: Alexander Motin Message-ID: <20070827095550.0be62785@localhost> In-Reply-To: <46D17813.8090205@FreeBSD.org> References: <1188123847.00792375.1188111626@10.7.7.3> <46D17813.8090205@FreeBSD.org> X-Mailer: Claws Mail 2.10.0 (GTK+ 2.10.14; i386-portbld-freebsd6.2) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: FreeBSD Net ML Subject: Re: Netgraph node to replace packet contents? X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Aug 2007 23:55:57 -0000 On Sun, 26 Aug 2007 15:54:43 +0300 Alexander Motin wrote: > Hi. > > Norberto Meijome wrote: > > is there any already existing Netgraph node that would allow me to replace bytes in the data part of a packet? I'm talking about generic "foo" for "BAR" replacement, though different lengths would be good too. > > There is no such node. > > This is not an easy task to alter some abstract packet. Even in > simpliest case you should take into account TCP/UDP checksumms. Yes, of course. > There > could be problems with fragmented packets. In more complicated cases may > be required other modifications. yes..i had thought of this > > To replace string with different length one you should also correct > packet length. It is possible for UDP (except for the not first packet > fragments), but for TCP it is probably completely impossible without > doing complete TCP proxying to modify sequence numbers. yes, TCP keeps rearing its problematic head ;) Anyway, thanks a lot for the insights :) B _________________________ {Beto|Norberto|Numard} Meijome Law of Conservation of Perversity: we can't make something simpler without making something else more complex I speak for myself, not my employer. Contents may be hot. Slippery when wet. Reading disclaimers makes you go blind. Writing them is worse. You have been Warned.