I need to query existing rules, as well as being able to easily add and delete rules. I haven\'t found any API\'s for doing this. Is there something that I\'m missing?
There is deliberately no API to manage these rules. You're not supposed to want to do so. Or something.
If you need rules which are sufficiently dynamic you care about the performance of executing /sbin/iptables, there are other ways to do it: