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" > From owner-freebsd-ipfw@freebsd.org Fri Nov 4 14:08:05 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 9E4D7C2FC1F for ; Fri, 4 Nov 2016 14:08:05 +0000 (UTC) (envelope-from nazari.s11@gmail.com) Received: from mail-wm0-x22d.google.com (mail-wm0-x22d.google.com [IPv6:2a00:1450:400c:c09::22d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 45C45FA9; Fri, 4 Nov 2016 14:08:05 +0000 (UTC) (envelope-from nazari.s11@gmail.com) Received: by mail-wm0-x22d.google.com with SMTP id p190so53409212wmp.1; Fri, 04 Nov 2016 07:08:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=YpeJ8selPBOILxEiMwTWpwtimOUveLKymF3pAwUwyz0=; b=nRUPYalFV/zywQPNW0tFh6MjYM9Q2+B3jLtYeKHhJMKsYggjpMKxRAiowqf5I36EiD 5RkUvCFCRSnxPOpoodjyYetDAo8zUMwN6UwCMlrONaQkHxeB4a7VzEThADY1ZN2w8aq7 WDH6m4PjyKTDgQWTvqUAEvRJZS2AJiqgNsIR2mVo/c1LsYlnM7UOLBVe1hXxF9Cyp+9q lPMPQgbNKopQYZfQ9jiozBtpReuCoXBs1ZyVqou/A25cK6pYNomZvMwWKoPGZi4fUG/+ Vs9vfIP3Sf63WLeahyvNi3K//xm2xakGIBssNFX4muAoIRj4iuKMDUeVHOuWaTXuB6JG 6W/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=YpeJ8selPBOILxEiMwTWpwtimOUveLKymF3pAwUwyz0=; b=d9g1HacUDKi6k7glmlmdBLYkSAtHGBnq76ppwAydjPh/OGWC9gCqRVF3fmlMGsKBM6 MAmSXrkQB1g0dDbz8zInbAFkrQGxFYamWU10ojjrPPBiUykYP0tPLq570b0w9RTUH/ut k73Mz/+Zvp9BYdzR+ZdicE+hW1jWqc4xlziidNLnikC+ooMusMbYIpl8StC+pdW9dmal fd+cl2g+mEQ4IK4f4Zecc6XHAVpgmWV2U9uyFJiCs9R+tM0MpsuNhSgH4TS2lZi15HM4 Y/1X2c81xKZG+wiEY4yq8UuObBD9l8Tb44X14fPmhEIs9bj4x9c5n4iZAVQjUv0tGcSB WF3w== X-Gm-Message-State: ABUngve2wFszUQq9r6Oa48kf3JXU6Zbh04TTYNc515GNB1Q8wNNjYquKYrzjPjWRVqT0Fgcl7Tlw/ASye2TdPQ== X-Received: by 10.194.153.228 with SMTP id vj4mr12211695wjb.204.1478268002395; Fri, 04 Nov 2016 07:00:02 -0700 (PDT) MIME-Version: 1.0 Received: by 10.28.166.198 with HTTP; Fri, 4 Nov 2016 07:00:01 -0700 (PDT) In-Reply-To: <1a23a7ee-8933-5a9a-4ac2-982df1fc9a80@freebsd.org> References: <20161019023739.D6806@sola.nimnet.asn.au> <1a23a7ee-8933-5a9a-4ac2-982df1fc9a80@freebsd.org> From: Samira Nazari Date: Fri, 4 Nov 2016 17:30:01 +0330 Message-ID: Subject: Re: change packets with IPFW divert To: Julian Elischer Cc: Ian Smith , "freebsd-ipfw@freebsd.org" , Shawn Bakhtiar Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.23 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: Fri, 04 Nov 2016 14:08:05 -0000 RTP header compression On Thu, Nov 3, 2016 at 11:41 AM, Julian Elischer wrote: > 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" >> >> >