From owner-freebsd-net@FreeBSD.ORG Wed May 21 19:41:47 2014 Return-Path: Delivered-To: net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 13309DE4; Wed, 21 May 2014 19:41:47 +0000 (UTC) Received: from mail-wg0-x22e.google.com (mail-wg0-x22e.google.com [IPv6:2a00:1450:400c:c00::22e]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 578AF2906; Wed, 21 May 2014 19:41:46 +0000 (UTC) Received: by mail-wg0-f46.google.com with SMTP id n12so2475940wgh.5 for ; Wed, 21 May 2014 12:41:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=mFeMimeKdxd6Pj6J7GMMZvHFWsVb8Z1c636yfIGELMc=; b=kMa5KPfAkudvGsTAyrAdqUDYb1QRZFH65uX1h20KoNEttRlEcXJyrKpbo+N8SDTKBF ZeAkAVtmIMSsE2FXqPlK+h5KXJfGK9yPF43WaPo6F49gJUUaL8NyHsPWl+tkoCZJxaTH SAKfYloATdz2RkI4GcXCy3ftmwd4OfbIg7SyrqE4QF9oMjS7TwHHCsj7Bfz6FTLwIhrm 4HfXlaK/dmj9sAydBw/CPM68m04oNOJOdg5AIjVboClbH671ksGfXr+qwdeMeOyPylpS orhc+qsWz9EZ0Y0vTdm1MTDSOe/RurPkFYpBSjCLgPu/G5IV1HUmv1mRoC/zmh/YmHtn CtAQ== MIME-Version: 1.0 X-Received: by 10.194.57.38 with SMTP id f6mr19013802wjq.59.1400701304495; Wed, 21 May 2014 12:41:44 -0700 (PDT) Received: by 10.216.116.136 with HTTP; Wed, 21 May 2014 12:41:44 -0700 (PDT) In-Reply-To: References: <5379FE3C.6060501@FreeBSD.org> <20140521111002.GB62462@onelab2.iet.unipi.it> Date: Thu, 22 May 2014 03:41:44 +0800 Message-ID: Subject: Re: [CFT]: ipfw named tables / different tabletypes From: Bill Yuan To: Luigi Rizzo Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.18 Cc: Luigi Rizzo , "Alexander V. Chernikov" , FreeBSD Net X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 May 2014 19:41:47 -0000 On Thu, May 22, 2014 at 12:49 AM, Luigi Rizzo wrote: > > > > On Wed, May 21, 2014 at 11:17 AM, Bill Yuan wrote: > >> 1. "each table can have it's own name", I like this idea. I am also >> working on this kind of functions, But I am in different way. In my >> opinion. the "name" or "type" of the table, all this are utility functio= n >> for the user. in the kernel space. I want to keep all the things the sam= e >> as before. and add a translate function in the user land commands, so th= at >> means we need to find a space to keep the mapping of the name<->id or >> type<->id, >> > > =E2=80=8Bthis does not work, you'd have another database to keep in sync > and on which you have races with modifications to the ipfw config. > > cheers > luigi > =E2=80=8B > Hi Luigi, Thanks for your reply. That is my original idea of the implementation. I though it is good because it can minimize the changes in existing code. Yes, It requires to have another database to keep in sync, But it is not necessary to mix a lot with the existing code in the userland. that also means we dont need to make any changes in the existing code of the kernel space. e.g. if we support the table name in the command , it will be: >ipfw table 1 name sales this type of commands to create/update the mapping databases >ipfw table sales add 1.2.3.4 >ipfw table sales list this type of commands need to call function "get_id_from_name()" and it is in the userland command. And if the mapping is "type-name-id" then that means it can be generic purpose. e.g. tablename-sale-10 --> sale table is id 10 pipename-vip-20 --> vip pipe's id is 20