From owner-freebsd-ipfw@FreeBSD.ORG Tue Mar 4 03:23:08 2008 Return-Path: Delivered-To: freebsd-ipfw@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7ECB2106567E for ; Tue, 4 Mar 2008 03:23:08 +0000 (UTC) (envelope-from araujobsdport@gmail.com) Received: from wr-out-0506.google.com (wr-out-0506.google.com [64.233.184.234]) by mx1.freebsd.org (Postfix) with ESMTP id 38FB88FC24 for ; Tue, 4 Mar 2008 03:23:07 +0000 (UTC) (envelope-from araujobsdport@gmail.com) Received: by wr-out-0506.google.com with SMTP id c49so187782wra.19 for ; Mon, 03 Mar 2008 19:23:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:reply-to:organization:user-agent:mime-version:to:cc:subject:references:in-reply-to:x-enigmail-version:openpgp:content-type:from; bh=b6lwa1SDxNLXvk9ERdSOe2ClBgD6+lBSoMUrhG1hCAE=; b=YY9l+4rKefm2//UNwsM/HHeOazhv3dOzC0kLJUaEtH+W7sG1cDJrOU9rA/80vNN10ZWfvEPgAWQvCMx4MTGcAHJmQ54JCElLYJCb4JUd3lKFpM+7RF5WtHV9spGuUZw8XgG9E2xEEzWE0Hpjzi6DpDK3J5K69NtIkSUp6yfjIr4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:reply-to:organization:user-agent:mime-version:to:cc:subject:references:in-reply-to:x-enigmail-version:openpgp:content-type:from; b=STIeXASYt3zo+nsBtUq6Em3pJX72evJxDiFYYj/9imi2n2wmfAQuj2lXMqcsUarynpAQXZBwxQ3pqrDx4ut53iiPVz46q90/ISRaX9fKNlKarvl6HlEGqzfkg1U2l2QmoiMN2b5DexSXMeZjB8GfZXSrOCSjeKOKX440TAtWbdk= Received: by 10.100.194.17 with SMTP id r17mr1104569anf.51.1204600985915; Mon, 03 Mar 2008 19:23:05 -0800 (PST) Received: from island.freebsd.org ( [201.47.46.186]) by mx.google.com with ESMTPS id n29sm1911743elf.5.2008.03.03.19.23.02 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 03 Mar 2008 19:23:05 -0800 (PST) Message-ID: <47CCC0AA.5030106@FreeBSD.org> Date: Tue, 04 Mar 2008 00:23:22 -0300 Organization: FreeBSD User-Agent: Thunderbird 2.0.0.0 (X11/20070521) MIME-Version: 1.0 To: araujo@FreeBSD.org References: <200802261908.m1QJ8n5N023371@freefall.freebsd.org> <47C4F2D1.5080703@yandex.ru> <47C5516F.9080200@FreeBSD.org> <47C64BB7.60309@yandex.ru> <47C68CD1.10409@FreeBSD.org> In-Reply-To: <47C68CD1.10409@FreeBSD.org> X-Enigmail-Version: 0.95.0 OpenPGP: id=53E4CFA8 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enigB3DDF2320604471DBB892B66" From: Marcelo Araujo X-Mailman-Approved-At: Tue, 04 Mar 2008 04:22:42 +0000 Cc: stas@mbsd.msk.ru, Luigi Rizzo , Oleg Bulyzhin , freebsd-ipfw@FreeBSD.org, "Andrey V. Elsukov" , Julian Elischer , Ion-Mihai Tetcu , "Bruce M. Simpson" , Vadim Goncharov Subject: ipfw modip [DF|TOS|DSCP|TTL] X-BeenThere: freebsd-ipfw@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: araujo@FreeBSD.org List-Id: IPFW Technical Discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Mar 2008 03:23:08 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigB3DDF2320604471DBB892B66 Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: quoted-printable Hi all, I started a work to create a new function called of modip, but I've some doubts around this implementation. I created inside of ipfw2.c a case statement called of TOK_SETMODIP, I check if user passed one of the options(DF,TOS,DSCP,TTL), after set an int with the respective value. Now, I need to call O_SETMODIP within ip_fw2.c going with parameter opmodip, and inside O_SETMODIP I can do a goto to O_SETIPTOSPRE as exampl= e. ipfw2.c: 4913 /* New Implementation MODIP. */ 4914 /* [DF|TOS|DSCP|TTL] */ 4915 case TOK_SETMODIP: { 4916 int opmodip =3D 0; 4917 NEED1("need modip [DF|TOS|DSCP|TTL] arg\n"); 4918 if (_substrcmp(*av, "DF") =3D=3D 0 || 4919 _substrcmp(*av, "df") =3D=3D 0) { 4920 opmodip =3D 1; 4921 printf("DF.....\n"); 4922 } else if (_substrcmp(*av, "TOS") =3D=3D 0 || 4923 _substrcmp(*av, "tos") =3D=3D 0) { 4924 opmodip =3D 2; 4925 printf("TOS....\n"); 4926 } else if (_substrcmp(*av, "DSCP") =3D=3D 0 || 4927 _substrcmp(*av, "dscp") =3D=3D 0) { 4928 opmodip =3D 3; 4929 printf("DSCP....\n"); 4930 } else if (_substrcmp(*av, "TTL") =3D=3D 0 || 4931 _substrcmp(*av, "ttl") =3D=3D 0) { 4932 opmodip =3D 4; 4933 printf("TTL....\n"); 4934 } else { 4935 opmodip =3D 0; 4936 printf("0.....\n"); 4937 } 4938 fill_cmd(cmd, O_SETMODIP, 0, modip); 4939 ac--; av++; 4940 printf("Value %d\n", opmodip); 4941 break; 4942 } ip_fw2.c: 3244 /* New Implementation MODIP. */ 3245 case O_SETMODIP: 3246 printf("Entry ip_fw2.c\n"); 3247 switch (cmd->arg1) { 3248 case 1: 3249 printf("DF\n"); 3250 break; 3251 case 2: 3252 printf("TOS\n"); 3253 goto O_SETIPTOSPRE; 3254 break; 3255 case 3: 3256 printf("DSCP\n"); 3257 break; 3258 case 4: 3259 printf("TTL\n"); 3260 break; 3261 default: 3262 printf("0000000\n"); 3263 break; 3264 } When I execute the ipfw with the option I've this output: island# ipfw add modip ipfw: need modip [DF|TOS|DSCP|TTL] arg and island# ipfw add modip tos TOS.... ipfw: invalid flag tos I'd like to pass as follows: island# ipfw add modip tos flashover ip from any to any My problem I believe are in fill_cmd(). Somebody can help me with this problem?=20 Best Regards, --=20 Marcelo Araujo (__) araujo@FreeBSD.org \\\'',) http://www.FreeBSD.org \/ \ ^ Power To Server. .\. /_) --------------enigB3DDF2320604471DBB892B66 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (FreeBSD) iD8DBQFHzMCvovxJd1Pkz6gRAusaAJ9rgDi20ZYyEoDkHhUvIIs3SkzyhACgh9e+ I0+me0mLj52SA6fECXXTMbI= =lYCt -----END PGP SIGNATURE----- --------------enigB3DDF2320604471DBB892B66--