From owner-freebsd-hackers Fri Jun 1 17:27:12 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from mailout02.sul.t-online.de (mailout02.sul.t-online.com [194.25.134.17]) by hub.freebsd.org (Postfix) with ESMTP id 1224537B43C for ; Fri, 1 Jun 2001 17:27:09 -0700 (PDT) (envelope-from bfischer@Techfak.Uni-Bielefeld.DE) Received: from fwd07.sul.t-online.de by mailout02.sul.t-online.de with smtp id 155zFy-0004p6-01; Sat, 02 Jun 2001 02:27:06 +0200 Received: from frolic.no-support.loc (520094253176-0001@[217.80.111.127]) by fmrl07.sul.t-online.com with esmtp id 155zFr-0bf9JwC; Sat, 2 Jun 2001 02:26:59 +0200 Received: from broccoli.no-support.loc (root@broccoli.no-support.loc [192.168.43.99]) by frolic.no-support.loc (8.11.3/8.9.3) with ESMTP id f520MBV05643; Sat, 2 Jun 2001 02:22:11 +0200 (CEST) (envelope-from bjoern@no-support.loc) From: Bjoern Fischer Received: (from bjoern@localhost) by broccoli.no-support.loc (8.11.3/8.9.3) id f520MBD00715; Sat, 2 Jun 2001 02:22:11 +0200 (CEST) (envelope-from bjoern@no-support.loc) Date: Sat, 2 Jun 2001 02:22:10 +0200 To: Urban Olsson Cc: freebsd-hackers@FreeBSD.ORG Subject: Re: modified FreeBSD gateway Message-ID: <20010602022210.A320@broccoli.no-support.loc> References: <778DFE9B4E3BD111A74E08002BA3DC0D03DA524A@trab-hermes.haninge.trab.se> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable User-Agent: Mutt/1.2.5i In-Reply-To: <778DFE9B4E3BD111A74E08002BA3DC0D03DA524A@trab-hermes.haninge.trab.se>; from Urban.E.Olsson@telia.se on Fri, Jun 01, 2001 at 12:54:43PM +0200 X-Sender: 520094253176-0001@t-dialin.net Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Hello Urban, > What I have done so far is to use the natd daemon as an example but I hav= e a > problem. The divert seems to work but the problem is that I can=B4t get t= he > packets in my userspace program. Is there some specific port that I should > use for the divert socket? This is not very clear in the natd code. I can= =B4t > find where the port is set and if it is a special port reserved for the > divert sockets. You create the divert socket with socket(PF_INET, SOCK_RAW, IPPROTO_DIVERT); The port is set as usual (bind(2)). You must specify the same port as it is configured into the ipfw divert or tee directive (you have properly configured ipfw?). See the manpages ipfw(8) and divert(4). In /usr/src/sbin/natd/natd.c the port is set pretty normally with bind() (line 241 fff.). Sure we talk about the the same code? IMHO the code is clean, straight forward and well commented. Bj=F6rn Fischer --=20 -----BEGIN GEEK CODE BLOCK----- GCS d--(+) s++: a- C+++(-) UB++++OSI++++$ P+++(-) L---(++) !E W- N+ o>+ K- !w !O !M !V PS++ PE- PGP++ t+++ !5 X++ tv- b+++ D++ G e+ h-- y+=20 ------END GEEK CODE BLOCK------ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message