iptables.h revision 617d3d140f4739558dce2ef8ed01aef251cf5487
1e6869a8f59d779ff4d5a0984c86d80db7078496Marc Boucher#ifndef _IPTABLES_USER_H
2e6869a8f59d779ff4d5a0984c86d80db7078496Marc Boucher#define _IPTABLES_USER_H
3e6869a8f59d779ff4d5a0984c86d80db7078496Marc Boucher
4ef18e8147903885708d1c264904129af4fb636d6Jan Engelhardt#include <netinet/ip.h>
5ef18e8147903885708d1c264904129af4fb636d6Jan Engelhardt#include <xtables.h>
6ef18e8147903885708d1c264904129af4fb636d6Jan Engelhardt#include <libiptc/libiptc.h>
7c02e80878979d2205f3d89d05548397871e598e9Jan Engelhardt#include <iptables/internal.h>
8e6869a8f59d779ff4d5a0984c86d80db7078496Marc Boucher
9e6869a8f59d779ff4d5a0984c86d80db7078496Marc Boucher/* Your shared library should call one of these. */
10e6869a8f59d779ff4d5a0984c86d80db7078496Marc Boucherextern int do_command(int argc, char *argv[], char **table,
11fd1873110f8e57be578df17fc9d03536b10f4f73Jan Engelhardt		      struct iptc_handle **handle);
12a114e9e8be802ab744d442449b3ec7de03c58621Harald Welteextern int delete_chain(const ipt_chainlabel chain, int verbose,
131c9015b2cb483678f153121255e10ec0bbfde3e6Jan Engelhardt			struct iptc_handle *handle);
14a114e9e8be802ab744d442449b3ec7de03c58621Harald Welteextern int flush_entries(const ipt_chainlabel chain, int verbose,
151c9015b2cb483678f153121255e10ec0bbfde3e6Jan Engelhardt			struct iptc_handle *handle);
161c9015b2cb483678f153121255e10ec0bbfde3e6Jan Engelhardtextern int for_each_chain(int (*fn)(const ipt_chainlabel, int, struct iptc_handle *),
171c9015b2cb483678f153121255e10ec0bbfde3e6Jan Engelhardt		int verbose, int builtinstoo, struct iptc_handle *handle);
1896296cfb7e01298234c7fa9403619f50391620d1Henrik Nordstromextern void print_rule(const struct ipt_entry *e,
191c9015b2cb483678f153121255e10ec0bbfde3e6Jan Engelhardt		struct iptc_handle *handle, const char *chain, int counters);
208cf65913bb6353bf0e92eab0669d1c4c53b43623Phil Oester
218cf65913bb6353bf0e92eab0669d1c4c53b43623Phil Oester/* kernel revision handling */
228cf65913bb6353bf0e92eab0669d1c4c53b43623Phil Oesterextern int kernel_version;
238cf65913bb6353bf0e92eab0669d1c4c53b43623Phil Oesterextern void get_kernel_version(void);
248cf65913bb6353bf0e92eab0669d1c4c53b43623Phil Oester#define LINUX_VERSION(x,y,z)	(0x10000*(x) + 0x100*(y) + z)
258cf65913bb6353bf0e92eab0669d1c4c53b43623Phil Oester#define LINUX_VERSION_MAJOR(x)	(((x)>>16) & 0xFF)
268cf65913bb6353bf0e92eab0669d1c4c53b43623Phil Oester#define LINUX_VERSION_MINOR(x)	(((x)>> 8) & 0xFF)
278cf65913bb6353bf0e92eab0669d1c4c53b43623Phil Oester#define LINUX_VERSION_PATCH(x)	( (x)      & 0xFF)
288cf65913bb6353bf0e92eab0669d1c4c53b43623Phil Oester
29617d3d140f4739558dce2ef8ed01aef251cf5487Jamal Hadi Salimextern struct xtables_globals iptables_globals;
30617d3d140f4739558dce2ef8ed01aef251cf5487Jamal Hadi Salim
31e6869a8f59d779ff4d5a0984c86d80db7078496Marc Boucher#endif /*_IPTABLES_USER_H*/
32