From owner-freebsd-hackers Fri Mar 14 12:31:20 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id MAA10218 for hackers-outgoing; Fri, 14 Mar 1997 12:31:20 -0800 (PST) Received: from awfulhak.demon.co.uk (awfulhak.demon.co.uk [158.152.17.1]) by freefall.freebsd.org (8.8.5/8.8.5) with ESMTP id MAA10206; Fri, 14 Mar 1997 12:31:08 -0800 (PST) Received: from awfulhak.demon.co.uk (localhost.lan.awfulhak.org [127.0.0.1]) by awfulhak.demon.co.uk (8.8.5/8.8.5) with ESMTP id UAA25135; Fri, 14 Mar 1997 20:27:02 GMT Message-Id: <199703142027.UAA25135@awfulhak.demon.co.uk> X-Mailer: exmh version 1.6.9 8/22/96 To: "John H. Aughey" cc: freebsd-hackers@freefall.freebsd.org Subject: Re: Pre/Post processing IP packets In-reply-to: Your message of "Fri, 14 Mar 1997 09:45:03 PST." <199703141745.JAA01129@freefall.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Fri, 14 Mar 1997 20:27:02 +0000 From: Brian Somers Sender: owner-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk > I want to be able to pre-process and post-process IP packets which > are received by a network interface or are going out a network > interface. Basically I want to be able to look at an IP packet > immediately after it's received by an interface, fiddle around with > the packet, and then pass the modified packet back to the kernel > for further processing. In the same way I want to look at a packet > that is going out an interface, fiddle around with the packet, and > then pass the modified packet back to the kernel for actual > transmission. Have a look on http://www.srv.com/~cmott. The natd program is a good example of using divert(4) sockets. The idea is that you tell the firewall software to "divert" certain packets to a given raw socket. You then write a program that sits on that raw socket, plays with packets and re-injects them into the ip handling routines in the kernel. I'm going to make a "port" of natd soon, but I've been quite busy lately :| -- Brian , Don't _EVER_ lose your sense of humour....