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 | |
Martin Josefsson | 357d59d | 2004-12-27 19:49:28 +0000 | [diff] [blame] | 7 | #ifndef IPT_LIB_DIR |
Yasuyuki KOZAKAI | 5cd1ff5 | 2007-07-24 05:55:12 +0000 | [diff] [blame] | 8 | #define IPT_LIB_DIR XT_LIB_DIR |
Patrick McHardy | 9561606 | 2007-01-11 09:08:22 +0000 | [diff] [blame] | 9 | #endif |
Harald Welte | db0422f | 2004-03-04 07:45:30 +0000 | [diff] [blame] | 10 | |
Rusty Russell | 3aef54d | 2005-01-03 03:48:40 +0000 | [diff] [blame] | 11 | #ifndef IPT_SO_GET_REVISION_MATCH /* Old kernel source. */ |
| 12 | #define IPT_SO_GET_REVISION_MATCH (IPT_BASE_CTL + 2) |
| 13 | #define IPT_SO_GET_REVISION_TARGET (IPT_BASE_CTL + 3) |
Rusty Russell | 3aef54d | 2005-01-03 03:48:40 +0000 | [diff] [blame] | 14 | #endif /* IPT_SO_GET_REVISION_MATCH Old kernel source */ |
| 15 | |
Yasuyuki KOZAKAI | 0d502bc | 2007-07-24 05:52:07 +0000 | [diff] [blame] | 16 | #define iptables_rule_match xtables_rule_match |
| 17 | #define iptables_match xtables_match |
| 18 | #define iptables_target xtables_target |
| 19 | #define ipt_tryload xt_tryload |
Marc Boucher | e6869a8 | 2000-03-20 06:03:29 +0000 | [diff] [blame] | 20 | |
Illes Marci | 63e9063 | 2003-03-03 08:08:37 +0000 | [diff] [blame] | 21 | extern int line; |
| 22 | |
Marc Boucher | e6869a8 | 2000-03-20 06:03:29 +0000 | [diff] [blame] | 23 | /* Your shared library should call one of these. */ |
| 24 | extern void register_match(struct iptables_match *me); |
| 25 | extern void register_target(struct iptables_target *me); |
| 26 | |
Rusty Russell | 79dee07 | 2000-05-02 16:45:16 +0000 | [diff] [blame] | 27 | extern struct in_addr *dotted_to_addr(const char *dotted); |
Pablo Neira Ayuso | 267a570 | 2006-11-29 13:32:32 +0000 | [diff] [blame] | 28 | extern struct in_addr *dotted_to_mask(const char *dotted); |
Marc Boucher | e6869a8 | 2000-03-20 06:03:29 +0000 | [diff] [blame] | 29 | extern char *addr_to_dotted(const struct in_addr *addrp); |
Marc Boucher | b93c798 | 2001-12-06 14:50:19 +0000 | [diff] [blame] | 30 | extern char *addr_to_anyname(const struct in_addr *addr); |
| 31 | extern char *mask_to_dotted(const struct in_addr *mask); |
| 32 | |
| 33 | extern void parse_hostnetworkmask(const char *name, struct in_addr **addrpp, |
| 34 | struct in_addr *maskp, unsigned int *naddrs); |
| 35 | extern u_int16_t parse_protocol(const char *s); |
Marc Boucher | e6869a8 | 2000-03-20 06:03:29 +0000 | [diff] [blame] | 36 | |
| 37 | extern int do_command(int argc, char *argv[], char **table, |
| 38 | iptc_handle_t *handle); |
Harald Welte | a114e9e | 2000-12-01 14:28:19 +0000 | [diff] [blame] | 39 | extern int delete_chain(const ipt_chainlabel chain, int verbose, |
| 40 | iptc_handle_t *handle); |
| 41 | extern int flush_entries(const ipt_chainlabel chain, int verbose, |
| 42 | iptc_handle_t *handle); |
| 43 | extern int for_each_chain(int (*fn)(const ipt_chainlabel, int, iptc_handle_t *), |
| 44 | int verbose, int builtinstoo, iptc_handle_t *handle); |
Phil Oester | 8cf6591 | 2005-09-19 15:00:33 +0000 | [diff] [blame] | 45 | |
| 46 | /* kernel revision handling */ |
| 47 | extern int kernel_version; |
| 48 | extern void get_kernel_version(void); |
| 49 | #define LINUX_VERSION(x,y,z) (0x10000*(x) + 0x100*(y) + z) |
| 50 | #define LINUX_VERSION_MAJOR(x) (((x)>>16) & 0xFF) |
| 51 | #define LINUX_VERSION_MINOR(x) (((x)>> 8) & 0xFF) |
| 52 | #define LINUX_VERSION_PATCH(x) ( (x) & 0xFF) |
| 53 | |
Marc Boucher | e6869a8 | 2000-03-20 06:03:29 +0000 | [diff] [blame] | 54 | #endif /*_IPTABLES_USER_H*/ |