From owner-freebsd-ipfw@freebsd.org Wed Jan 20 16:43:30 2021 Return-Path: Delivered-To: freebsd-ipfw@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D59944FB77D for ; Wed, 20 Jan 2021 16:43:30 +0000 (UTC) (envelope-from bu7cher@yandex.ru) Received: from forward100j.mail.yandex.net (forward100j.mail.yandex.net [5.45.198.240]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4DLWYY4BqTz3HDT for ; Wed, 20 Jan 2021 16:43:29 +0000 (UTC) (envelope-from bu7cher@yandex.ru) Received: from myt5-70eb0a1f1a7b.qloud-c.yandex.net (myt5-70eb0a1f1a7b.qloud-c.yandex.net [IPv6:2a02:6b8:c12:3e23:0:640:70eb:a1f]) by forward100j.mail.yandex.net (Yandex) with ESMTP id 6D9AA50E0724; Wed, 20 Jan 2021 19:43:26 +0300 (MSK) Received: from myt5-aad1beefab42.qloud-c.yandex.net (myt5-aad1beefab42.qloud-c.yandex.net [2a02:6b8:c12:128:0:640:aad1:beef]) by myt5-70eb0a1f1a7b.qloud-c.yandex.net (mxback/Yandex) with ESMTP id zVnbsiroal-hPH0DRnV; Wed, 20 Jan 2021 19:43:26 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1611161006; bh=LUrr6cxQT3Jgnwy8CvDAlwYdoozAyl5vQxnUhVQ0KX8=; h=In-Reply-To:From:Date:References:To:Subject:Message-ID; b=skvZuwkUw9prkyz/RWwwhQ84x/MDy1u5Bbzh90o95D1F/AY/LfMViqrh9eRrCCUq/ HnZfUdYkoMczo9FPGiJ5+dvbhzWSDUEE29N/L45r+GyN5IrZCPkrPI5IT6KRs6Ut0P NI21Bt1i1UokdY5OJliYaA0UEYfLtJAFBgclqdvM= Received: by myt5-aad1beefab42.qloud-c.yandex.net (smtp/Yandex) with ESMTPSA id 8BvgprSRmf-hOnOhwIp; Wed, 20 Jan 2021 19:43:24 +0300 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client certificate not present) Subject: Re: Lookup tables with dst-port as argument To: Patrick Tracanelli , freebsd-ipfw@freebsd.org References: <2BBD30C7-044F-4846-9845-C7605306CB5B@freebsdbrasil.com.br> From: "Andrey V. Elsukov" Message-ID: <53b369d9-7db9-69ab-4db5-db19e18a7051@yandex.ru> Date: Wed, 20 Jan 2021 19:41:57 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:78.0) Gecko/20100101 Thunderbird/78.6.1 MIME-Version: 1.0 In-Reply-To: <2BBD30C7-044F-4846-9845-C7605306CB5B@freebsdbrasil.com.br> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4DLWYY4BqTz3HDT X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=yandex.ru header.s=mail header.b=skvZuwkU; dmarc=pass (policy=none) header.from=yandex.ru; spf=pass (mx1.freebsd.org: domain of bu7cher@yandex.ru designates 5.45.198.240 as permitted sender) smtp.mailfrom=bu7cher@yandex.ru X-Spamd-Result: default: False [-4.10 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; FREEMAIL_FROM(0.00)[yandex.ru]; R_SPF_ALLOW(-0.20)[+ip4:5.45.192.0/19]; RCVD_COUNT_THREE(0.00)[4]; DKIM_TRACE(0.00)[yandex.ru:+]; RCPT_COUNT_TWO(0.00)[2]; DMARC_POLICY_ALLOW(-0.50)[yandex.ru,none]; NEURAL_HAM_SHORT(-1.00)[-0.999]; RCVD_IN_DNSWL_LOW(-0.10)[5.45.198.240:from]; RCVD_TLS_LAST(0.00)[]; RBL_DBL_DONT_QUERY_IPS(0.00)[5.45.198.240:from]; FREEMAIL_ENVFROM(0.00)[yandex.ru]; ASN(0.00)[asn:13238, ipnet:5.45.192.0/18, country:RU]; MID_RHS_MATCH_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[yandex.ru:dkim]; MIME_TRACE(0.00)[0:+]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[yandex.ru:s=mail]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; SPAMHAUS_ZRD(0.00)[5.45.198.240:from:127.0.2.255]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RWL_MAILSPIKE_POSSIBLE(0.00)[5.45.198.240:from]; MAILMAN_DEST(0.00)[freebsd-ipfw] X-BeenThere: freebsd-ipfw@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: IPFW Technical Discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jan 2021 16:43:30 -0000 On 20.01.2021 18:26, Patrick Tracanelli wrote: > Hello FreeBSD community, > > I need to dynamically allocate filtering ports on a tuplet, table > would do the job, can I lookup the port argument from a table? > Something like: > > ipfw add count all from “table(blist)” to any dst-port tablearg in > > In the above example table blist was created as “ipfw table blist > create type number”. > > It certainly won’t work as above written since tablearg is not > supported for dst-port. > > Is there any other approach possible to reach this desired behavior? Hi, it seems you need to take alook at the 'lookup dst-port tablename' opcode. -- WBR, Andrey V. Elsukov