From owner-freebsd-questions@FreeBSD.ORG Tue May 24 14:40:34 2005 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id EE0B816A41C for ; Tue, 24 May 2005 14:40:34 +0000 (GMT) (envelope-from dan@dan.emsphone.com) Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by mx1.FreeBSD.org (Postfix) with ESMTP id 91F3143D1F for ; Tue, 24 May 2005 14:40:34 +0000 (GMT) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.13.1/8.13.3) id j4OEdk9B091945; Tue, 24 May 2005 09:39:46 -0500 (CDT) (envelope-from dan) Date: Tue, 24 May 2005 09:39:46 -0500 From: Dan Nelson To: "C.G.Senthilkumar." Message-ID: <20050524143945.GE16069@dan.emsphone.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-OS: FreeBSD 5.4-STABLE X-message-flag: Outlook Error User-Agent: Mutt/1.5.9i Cc: freebsd-questions@freebsd.org Subject: Re: libiptc equivalent in FreeBSD ipfw X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 May 2005 14:40:35 -0000 In the last episode (May 23), C.G.Senthilkumar. said: > I want to add some rules to the ipfw kernel table directly from my > program rather than going through the ipfw user-space program. Is > there some control library analogous to libiptc in Linux's > netfilter/iptables that would let me do that? > > If yes, where could I learn more about it? No, /usr/sbin/ipfw is the only "API" available. If you don't want the overhead of forking a new process every time you want to add or change a rule, you can fork an ipfw in the background when your program starts: "ipfw /dev/fd/0" will take commands on stdin and print to stdout. -- Dan Nelson dnelson@allantgroup.com