Hey Frangois, Thus spake fv ([EMAIL PROTECTED]): > I'm studying the idea of writing a python library for controling pf > internals. > Do would find it usefull to write some simple scripts for controling PF. > Is anyone think it's usefull ?
I write and maintain pyopenbsd, a set of Python bindings for OpenBSD. It has support for kqueues, ifconfig-like functionality, netstat-like functionality, and PF. With regards to PF, we support adding, removing and manipulating tables, inspecting and manipulating state entries, starting and stopping PF, ALTQ, inspecting statistics, etc. To give you a flavour, here's a code example: from openbsd.pf import * p = PF() p["pftest"].tables.add("mytable") # Add a table called "mytable" to the anchor "pftest" tbl = self.p["pftest"].tables["mytable"] addrs = tbl.addAddress(Address("192.168.0.3")) # Add an address to our table print addrs tbl.deleteAddress(addrs[0]) # Delete the first address in the table The project is tracked and developed (along with some other projects) at http://dev.nullcube.com. You can check out the source from: svn://dev.nullcube.com/public/pyopenbsd We would love to have more contributors - take a look and drop me a line if you're interested. Cheers, Aldo -- Aldo Cortesi [EMAIL PROTECTED] http://www.nullcube.com Mob: 0419 492 863