From owner-freebsd-ipfw@freebsd.org Thu Nov 3 08:11:16 2016 Return-Path: Delivered-To: freebsd-ipfw@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5100FC2C205 for ; Thu, 3 Nov 2016 08:11:16 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "vps1.elischer.org", Issuer "CA Cert Signing Authority" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 8237A1EF2 for ; Thu, 3 Nov 2016 08:11:15 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from Julian-MBP3.local (ppp121-45-232-92.lns20.per1.internode.on.net [121.45.232.92]) (authenticated bits=0) by vps1.elischer.org (8.15.2/8.15.2) with ESMTPSA id uA38B9dK057604 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Thu, 3 Nov 2016 01:11:12 -0700 (PDT) (envelope-from julian@freebsd.org) Subject: Re: change packets with IPFW divert To: Samira Nazari , Ian Smith References: <20161019023739.D6806@sola.nimnet.asn.au> Cc: "freebsd-ipfw@freebsd.org" , Shawn Bakhtiar From: Julian Elischer Message-ID: <1a23a7ee-8933-5a9a-4ac2-982df1fc9a80@freebsd.org> Date: Thu, 3 Nov 2016 16:11:03 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-ipfw@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: IPFW Technical Discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Nov 2016 08:11:16 -0000 On 19/10/2016 1:56 PM, Samira Nazari wrote: > Thank you for all of your comments and help. > In fact, I want to divert packets for one program that do header compression What kind of header compression? Also look at netgraph. > > Sam, Naz > > On Tue, Oct 18, 2016 at 7:33 PM, Ian Smith wrote: > >> On Tue, 18 Oct 2016 14:21:50 +0000, Shawn Bakhtiar wrote: >> > On Oct 18, 2016, at 6:49 AM, Samira Nazari > > wrote: >> > > Hello every one, >> > > When we diverte packets to the specified port with "IPFW divert" , >> > > we can change it and re-sent to the kernel? >> >> > Not sure what you mean by change it but: >> > >> > "Divert sockets are similar to raw IP sockets, except that they can >> > be bound to a specific divert port via the bind(2) system call. The >> > IP address in the bind is ignored; only the port number is >> > significant. A divert socket bound to a divert port will receive all >> > packets diverted to that port by some (here unspecified) kernel >> > mechanism(s). Packets may also be written to a divert port, in which >> > case they re-enter kernel IP packet processing." >> > >> > -- SRC: https://www.freebsd.org/cgi/man.cgi?query=divert&sektion= >> 4&apropos=0&manpath=FreeBSD+10.3-RELEASE+and+Ports >> >> Apart from divert(4), most likely the best example is the natd(8) code, >> which modifies packet source or destination addresses and (maybe) ports. >> >> Ignoring the NAT processing - or not, as appropriate - the way natd uses >> divert sockets both to receive packets from ipfw and later (perhaps) to >> reinject them for further processing should show clearly how it's done. >> >> cheers, Ian >> > _______________________________________________ > freebsd-ipfw@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-ipfw > To unsubscribe, send any mail to "freebsd-ipfw-unsubscribe@freebsd.org" >