libiptc equivalent in FreeBSD ipfw

Dan Nelson dnelson at allantgroup.com
Tue May 24 07:40:35 PDT 2005


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 at allantgroup.com


More information about the freebsd-questions mailing list