7

I am writing an application using libc, for that am in search of an api for iptables so that i can add firewall rules using my program .is there any available set of api to do this.

cc4re
  • 4,821
  • 3
  • 20
  • 27

1 Answers1

5

You can use libiptc

Quote from the howto page:

libiptc is the library that is used to communicate with netfilter, the internal kernel code in charge of firewalling and packet filtering. This code and iptables were written by Paul "Rusty" Russell. iptables was developed using libiptc calls to get the job done.

http://tldp.org/HOWTO/Querying-libiptc-HOWTO/whatis.html

Eloims
  • 5,106
  • 4
  • 25
  • 41