From owner-freebsd-net@FreeBSD.ORG Wed Sep 24 10:50:17 2008 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1D600106567F; Wed, 24 Sep 2008 10:50:17 +0000 (UTC) (envelope-from ganbold@micom.mng.net) Received: from publicd.ub.mng.net (publicd.ub.mng.net [202.179.0.88]) by mx1.freebsd.org (Postfix) with ESMTP id C9F178FC1F; Wed, 24 Sep 2008 10:50:16 +0000 (UTC) (envelope-from ganbold@micom.mng.net) Received: from [202.179.21.135] (helo=devil.micom.mng.net) by publicd.ub.mng.net with esmtpa (Exim 4.69 (FreeBSD)) (envelope-from ) id 1KiRwk-000GkV-QA; Wed, 24 Sep 2008 18:50:14 +0800 Message-ID: <48DA1B65.8030106@micom.mng.net> Date: Wed, 24 Sep 2008 18:50:13 +0800 From: Ganbold User-Agent: Thunderbird 2.0.0.16 (X11/20080901) MIME-Version: 1.0 To: freebsd-ipfw@freebsd.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-net@freebsd.org, luigi@FreeBSD.org, julian@FreeBSD.org Subject: ipfw port lookup table patch for review X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 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, 24 Sep 2008 10:50:17 -0000 Hi, I thought it might be useful to have port lookup table similar to existing IP lookup table in ipfw and I have made patch for that. The downside of the patch so far I'm seeing is the port entries are in linked list (no limitation yet, memory overhead), not sorted and it uses linear search to match (could be slow when lot of entries). Just after I've made the patch I saw http://www.freebsd.org/cgi/query-pr.cgi?pr=121807&cat= . :( I agree with PR's reply however for small number of port entries I thought this functionality is quite useful. It gives benefit like no need to modify existing rule, adding/deleting port entries is easy. I did some small tests and it seems like working. Patches are at: http://people.freebsd.org/~ganbold/ipfw_port_table/ The output of some usage samples is at: http://people.freebsd.org/~ganbold/ipfw_port_table/ipfw_port_table_usage_sample.txt Patches can be successfully applied to CURRENT. Didn't test RELENG_7 due to no RELENG_7 PC :) Please let me know your thoughts. I'm happy to discuss to improve the patch. Correct me if I'm doing something wrong here. thanks, Ganbold