From owner-freebsd-ipfw@FreeBSD.ORG Mon Jun 1 14:22:45 2015 Return-Path: Delivered-To: freebsd-ipfw@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EF105863 for ; Mon, 1 Jun 2015 14:22:45 +0000 (UTC) (envelope-from rizzo.unipi@gmail.com) Received: from mail-la0-x236.google.com (mail-la0-x236.google.com [IPv6:2a00:1450:4010:c03::236]) (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 5EDAC1433 for ; Mon, 1 Jun 2015 14:22:45 +0000 (UTC) (envelope-from rizzo.unipi@gmail.com) Received: by laei3 with SMTP id i3so15024156lae.3 for ; Mon, 01 Jun 2015 07:22:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=TzmKOQhojZQhVnTFFyJ16M2ga7N/PxmaVc9Om+PZD04=; b=fb+kGbse6ft5YTUQUrvKVoFtmnV7VDFJHTvXEUPHdtu1/SXGe6LGSl6ZCy/gX17yeW 8qfSPa3P3d+5V+c3pb2dNL02VNJwCno8ZZDvH9VhN6tg9KDjO1qdWCtEi6rdaISUj5de XCowLYuzkXpKiuPGKwIgXPdxfBnEYbo1cf8k5HH/ZxzXhd7MT9CfFQ/FxcjNumR+xq0k gJ4V6lI0vJn72APMGiiRyXkvhG52HcUMkX+TcaIeTdhNwWXMgd8FVfxYYVxGPFRSBmTy gsj43O9YKJYMlAl3Zls49V6EecRnWmLr3xMGalMdH3w9mqrcxvxbhJwkyIucE7ASn7hi GeTw== MIME-Version: 1.0 X-Received: by 10.152.5.72 with SMTP id q8mr21116044laq.83.1433168563595; Mon, 01 Jun 2015 07:22:43 -0700 (PDT) Sender: rizzo.unipi@gmail.com Received: by 10.114.230.103 with HTTP; Mon, 1 Jun 2015 07:22:43 -0700 (PDT) In-Reply-To: <1433151867517-6015918.post@n5.nabble.com> References: <1433151867517-6015918.post@n5.nabble.com> Date: Mon, 1 Jun 2015 16:22:43 +0200 X-Google-Sender-Auth: DDRO0Ele0WZUB0csEezs_HG7fk8 Message-ID: Subject: Re: chnage source of IPFW From: Luigi Rizzo To: samira Cc: "freebsd-ipfw@freebsd.org" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: freebsd-ipfw@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: IPFW Technical Discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Jun 2015 14:22:46 -0000 On Mon, Jun 1, 2015 at 11:44 AM, samira wrote: > Hello every one, > I want to add a parameter in commands for ipfw, like " ipfw add allow ud= p > from any to any *udpdatalen 10 * ". > =E2=80=8Badding commands is doable but it requires you to touch multiple parts of the code, namely: - the parsing function in userspace - the decoding function in userspace - the validate function in the kernel (typically one case in a large switch() statement) - the function implementation in the kernel (one case in another, even bigger switch statement) For things like "udpdatalen X" you might be better off doing something like " ... udp iplen X+20 ..." cheers luigi =E2=80=8B > > I changes in /usr/src/sbin/ipfw/ipfw2.c like tcpdatalen option and now i > have udpdatalen command correctly in cli, but when i add argument(10) thi= s > error occurred. > " *ipfw: getsockopt(IP_FW_ADD): Invalid argument* " > > also I define variables in /usr/src/sys/netinet/ip_fw.h and change .c fil= es > in /usr/src/sys/net pfil/ and build kernel and did not changed that error= . > > Thank you for all of your comments and help. > > > > > > > > -- > View this message in context: > http://freebsd.1045724.n5.nabble.com/chnage-source-of-IPFW-tp6015918.html > Sent from the freebsd-ipfw mailing list archive at Nabble.com. > _______________________________________________ > freebsd-ipfw@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-ipfw > To unsubscribe, send any mail to "freebsd-ipfw-unsubscribe@freebsd.org" > --=20 -----------------------------------------+------------------------------- Prof. Luigi RIZZO, rizzo@iet.unipi.it . Dip. di Ing. dell'Informazione http://www.iet.unipi.it/~luigi/ . Universita` di Pisa TEL +39-050-2217533 . via Diotisalvi 2 Mobile +39-338-6809875 . 56122 PISA (Italy) -----------------------------------------+-------------------------------