From owner-freebsd-ipfw@FreeBSD.ORG Mon Apr 21 14:36:00 2014 Return-Path: Delivered-To: freebsd-ipfw@freebsd.org Received: from mx2.freebsd.org (mx2.freebsd.org [8.8.178.116]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AF09C675 for ; Mon, 21 Apr 2014 14:36:00 +0000 (UTC) Received: from butcher-nb.yandex.net (hub.freebsd.org [IPv6:2001:1900:2254:206c::16:88]) by mx2.freebsd.org (Postfix) with ESMTP id 05160F8; Mon, 21 Apr 2014 14:35:59 +0000 (UTC) Message-ID: <53552C83.7060008@FreeBSD.org> Date: Mon, 21 Apr 2014 18:34:43 +0400 From: "Andrey V. Elsukov" User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 MIME-Version: 1.0 To: bycn82 , freebsd-ipfw@freebsd.org Subject: Re: how does it pass in the rule sets References: <5352298C.2090902@gmail.com> In-Reply-To: <5352298C.2090902@gmail.com> X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-ipfw@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: IPFW Technical Discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Apr 2014 14:36:00 -0000 On 19.04.2014 11:45, bycn82 wrote: > Hi, > can someone help to explain how does the user land command `ipfw` pass > the rule set into the hook function in the kernel? I assume that it must > be hardcoded in somewhere, but I did not find it yet. ipfw(8) uses raw socket and setsockopt(2)/getsockopt(2) functions to interact with kernel. In particular, do_cmd() function from ipfw2.c does it. -- WBR, Andrey V. Elsukov