From owner-freebsd-net@FreeBSD.ORG Sat Nov 9 07:10:37 2013 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 85A38729; Sat, 9 Nov 2013 07:10:37 +0000 (UTC) (envelope-from jilingshu@gmail.com) Received: from mail-qe0-x234.google.com (mail-qe0-x234.google.com [IPv6:2607:f8b0:400d:c02::234]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 35A482DF9; Sat, 9 Nov 2013 07:10:37 +0000 (UTC) Received: by mail-qe0-f52.google.com with SMTP id w7so2869080qeb.11 for ; Fri, 08 Nov 2013 23:10:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=ihTwXNl6q4wWFQpsPjZ2AIoAqYRRhESZAkKIEYoV/Lg=; b=dtkqHKiLQWeflA4JyxKjshUrmgcF8Z1EQd3gV3xZn1cuMECmCLeDYpoy5nQ4VegSEP NfzNGN7ygJEPg7NUnsRNYZQ+99fDxgwyql4y2gYe1kNWt2/xLdlJPKnwh6RJVy4fm1iY TgE0MBw1uTsMzXezk3FYAo/0iWIOVYr1ykdSrlB1jO81/qT0VYpZwkw8MnSLKu/JsAMi VIH6J3kJvSoCKtDicDNwnk5NZguHYEWEBYr/n/vu9q/J4NUPlUQ6eC1GQHv9qXjHqg8z 43XMAHaPT4Q85iVkw4vCw3Ie3pUACSsJEyGSldKk6jMLFygknC/fD8s200H02BcWJIwF S2tA== X-Received: by 10.224.94.8 with SMTP id x8mr30204460qam.1.1383981036048; Fri, 08 Nov 2013 23:10:36 -0800 (PST) Received: from [172.16.99.107] (stjhnf0148w-142162175108.dhcp-dynamic.fibreop.nl.bellaliant.net. [142.162.175.108]) by mx.google.com with ESMTPSA id v19sm31592176qaw.0.2013.11.08.23.10.35 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 08 Nov 2013 23:10:35 -0800 (PST) Message-ID: <527DDFEA.9050001@Gmail.com> Date: Sat, 09 Nov 2013 03:40:34 -0330 From: Bear User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0 MIME-Version: 1.0 To: Gleb Smirnoff Subject: Re: ng_patch and 802.11Q References: <527C799D.8020208@Gmail.com> <20131108215210.GH7577@FreeBSD.org> In-Reply-To: <20131108215210.GH7577@FreeBSD.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-net@freebsd.org X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Nov 2013 07:10:37 -0000 Hi, It seems a good idea... Do you have some example working on ng_ether? The manpage of ng_ether seems no example... On 11/8/2013 6:22 PM, Gleb Smirnoff wrote: > On Fri, Nov 08, 2013 at 02:11:49AM -0330, Bear wrote: > B> Hi all, > B> I want to modify VLAN priority by ng_patch. After reading the manpage of > B> ng_patch(http://www.freebsd.org/cgi/man.cgi?query=ng_patch) and the > B> example it given: > B> > B> > /usr/sbin/ngctl -f- <<-SEQ > B> > mkpeer ipfw: patch 200 in > B> > name ipfw:200 ttl_add > B> > msg ttl_add: setconfig { count=1 csum_flags=1 ops=[ \ > B> > { mode=2 value=3 length=1 offset=8 } ] } > B> > SEQ > B> > /sbin/ipfw add 150 netgraph 200 ip from any to simplex.remote.net > B> > B> It seems ng_patch can only modify IP header. However, the position of > B> VLAN header is before IP header and after Ethernet header. How can I > B> modify it? > > ipfw allows you to intercept packets at IP layer. Tp modify VLAN header, > you need to capture them earlier. May be ng_ether(4) will help you. >