1 #ifndef _IPTABLES_USER_H
2 #define _IPTABLES_USER_H
5 #include "libiptc/libiptc.h"
7 #ifndef IPT_SO_GET_REVISION_MATCH /* Old kernel source. */
8 #define IPT_SO_GET_REVISION_MATCH (IPT_BASE_CTL + 2)
9 #define IPT_SO_GET_REVISION_TARGET (IPT_BASE_CTL + 3)
10 #endif /* IPT_SO_GET_REVISION_MATCH Old kernel source */
12 #define iptables_rule_match xtables_rule_match
13 #define ipt_tryload xt_tryload
17 /* Your shared library should call one of these. */
18 extern int do_command(int argc, char *argv[], char **table,
19 iptc_handle_t *handle);
20 extern int delete_chain(const ipt_chainlabel chain, int verbose,
21 iptc_handle_t *handle);
22 extern int flush_entries(const ipt_chainlabel chain, int verbose,
23 iptc_handle_t *handle);
24 extern int for_each_chain(int (*fn)(const ipt_chainlabel, int, iptc_handle_t *),
25 int verbose, int builtinstoo, iptc_handle_t *handle);
26 extern void print_rule(const struct ipt_entry *e,
27 iptc_handle_t *handle, const char *chain, int counters);
29 /* kernel revision handling */
30 extern int kernel_version;
31 extern void get_kernel_version(void);
32 #define LINUX_VERSION(x,y,z) (0x10000*(x) + 0x100*(y) + z)
33 #define LINUX_VERSION_MAJOR(x) (((x)>>16) & 0xFF)
34 #define LINUX_VERSION_MINOR(x) (((x)>> 8) & 0xFF)
35 #define LINUX_VERSION_PATCH(x) ( (x) & 0xFF)
37 #endif /*_IPTABLES_USER_H*/