| Marc Boucher | e6869a8 | 2000-03-20 06:03:29 +0000 | [diff] [blame] | 1 | #ifndef _IPTABLES_USER_H |
| 2 | #define _IPTABLES_USER_H |
| 3 | |
| Yasuyuki KOZAKAI | 0d502bc | 2007-07-24 05:52:07 +0000 | [diff] [blame] | 4 | #include "xtables.h" |
| Marc Boucher | e6869a8 | 2000-03-20 06:03:29 +0000 | [diff] [blame] | 5 | #include "libiptc/libiptc.h" |
| 6 | |
| Rusty Russell | 3aef54d | 2005-01-03 03:48:40 +0000 | [diff] [blame] | 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) |
| Rusty Russell | 3aef54d | 2005-01-03 03:48:40 +0000 | [diff] [blame] | 10 | #endif /* IPT_SO_GET_REVISION_MATCH Old kernel source */ |
| 11 | |
| Yasuyuki KOZAKAI | 0d502bc | 2007-07-24 05:52:07 +0000 | [diff] [blame] | 12 | #define iptables_rule_match xtables_rule_match |
| Yasuyuki KOZAKAI | 0d502bc | 2007-07-24 05:52:07 +0000 | [diff] [blame] | 13 | #define ipt_tryload xt_tryload |
| Marc Boucher | e6869a8 | 2000-03-20 06:03:29 +0000 | [diff] [blame] | 14 | |
| Illes Marci | 63e9063 | 2003-03-03 08:08:37 +0000 | [diff] [blame] | 15 | extern int line; |
| 16 | |
| Marc Boucher | e6869a8 | 2000-03-20 06:03:29 +0000 | [diff] [blame] | 17 | /* Your shared library should call one of these. */ |
| Marc Boucher | e6869a8 | 2000-03-20 06:03:29 +0000 | [diff] [blame] | 18 | extern int do_command(int argc, char *argv[], char **table, |
| 19 | iptc_handle_t *handle); |
| Harald Welte | a114e9e | 2000-12-01 14:28:19 +0000 | [diff] [blame] | 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); |
| Henrik Nordstrom | 96296cf | 2008-05-13 13:08:26 +0200 | [diff] [blame] | 26 | extern void print_rule(const struct ipt_entry *e, |
| 27 | iptc_handle_t *handle, const char *chain, int counters); |
| Phil Oester | 8cf6591 | 2005-09-19 15:00:33 +0000 | [diff] [blame] | 28 | |
| 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) |
| 36 | |
| Marc Boucher | e6869a8 | 2000-03-20 06:03:29 +0000 | [diff] [blame] | 37 | #endif /*_IPTABLES_USER_H*/ |