From owner-freebsd-questions@FreeBSD.ORG Sat Feb 7 10:50:41 2015 Return-Path: Delivered-To: questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7CBD92C8 for ; Sat, 7 Feb 2015 10:50:41 +0000 (UTC) Received: from bede.qeng-ho.org (bede.qeng-ho.org [217.155.128.241]) (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 C2A828EF for ; Sat, 7 Feb 2015 10:50:40 +0000 (UTC) Received: from arthur.home.qeng-ho.org (arthur.home.qeng-ho.org [172.23.1.2]) by bede.home.qeng-ho.org (8.14.9/8.14.7) with ESMTP id t17AiMrt032490; Sat, 7 Feb 2015 10:44:22 GMT (envelope-from freebsd@qeng-ho.org) Message-ID: <54D5EC86.6050806@qeng-ho.org> Date: Sat, 07 Feb 2015 10:44:22 +0000 From: Arthur Chance User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: "Dan Mahoney, System Admin" , questions@freebsd.org Subject: Re: IPFW script that supports some kind of rc.d directory? References: In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Feb 2015 10:50:41 -0000 On 07/02/2015 10:02, Dan Mahoney, System Admin wrote: > Hey all, > > This seems like the kind of thing that people have needed often enough > -- for example when you want to have specific ipfw rules for specific > installed services, and your ipfw config to be multiple files loaded in > some kind of order, but my google-fu is failing me. > > Failing that, I know FreeBSD has some rcorder, which might be usable for > this, but I don't know if it's extensible to a whole separate class of > things (or if trying to do that is overkill). > > Is this a problem someone else has had/solved before? > I've no idea if someone has already done this, but the final form of ipfw in the manual is ipfw [-cfnNqS] [-p preproc [preproc-flags]] pathname Using cpp as the preprocessor (or maybe m4 if you're a quote loving masochist :-) would let you use #include or the equivalent. That's not quite up what you're asking, but a start. m4 with syscmd and (s)include would go further. I think the major problem would be if different sets of rules had to be interleaved. That would require a careful choice of rule numbering. -- Those who do not learn from computing history are doomed to GOTO 1