blob: 99e8e1e1c1fe78ac67fc72fe69ad247f84d1880f [file] [log] [blame]
Marc Bouchere6869a82000-03-20 06:03:29 +00001#ifndef _IPTABLES_USER_H
2#define _IPTABLES_USER_H
3
Jan Engelhardtef18e812008-08-04 12:47:48 +02004#include <netinet/ip.h>
5#include <xtables.h>
6#include <libiptc/libiptc.h>
Marc Bouchere6869a82000-03-20 06:03:29 +00007
Rusty Russell3aef54d2005-01-03 03:48:40 +00008#ifndef IPT_SO_GET_REVISION_MATCH /* Old kernel source. */
9#define IPT_SO_GET_REVISION_MATCH (IPT_BASE_CTL + 2)
10#define IPT_SO_GET_REVISION_TARGET (IPT_BASE_CTL + 3)
Rusty Russell3aef54d2005-01-03 03:48:40 +000011#endif /* IPT_SO_GET_REVISION_MATCH Old kernel source */
12
Yasuyuki KOZAKAI0d502bc2007-07-24 05:52:07 +000013#define iptables_rule_match xtables_rule_match
Yasuyuki KOZAKAI0d502bc2007-07-24 05:52:07 +000014#define ipt_tryload xt_tryload
Marc Bouchere6869a82000-03-20 06:03:29 +000015
Illes Marci63e90632003-03-03 08:08:37 +000016extern int line;
17
Marc Bouchere6869a82000-03-20 06:03:29 +000018/* Your shared library should call one of these. */
Marc Bouchere6869a82000-03-20 06:03:29 +000019extern int do_command(int argc, char *argv[], char **table,
20 iptc_handle_t *handle);
Harald Weltea114e9e2000-12-01 14:28:19 +000021extern int delete_chain(const ipt_chainlabel chain, int verbose,
22 iptc_handle_t *handle);
23extern int flush_entries(const ipt_chainlabel chain, int verbose,
24 iptc_handle_t *handle);
25extern int for_each_chain(int (*fn)(const ipt_chainlabel, int, iptc_handle_t *),
26 int verbose, int builtinstoo, iptc_handle_t *handle);
Henrik Nordstrom96296cf2008-05-13 13:08:26 +020027extern void print_rule(const struct ipt_entry *e,
28 iptc_handle_t *handle, const char *chain, int counters);
Phil Oester8cf65912005-09-19 15:00:33 +000029
30/* kernel revision handling */
31extern int kernel_version;
32extern void get_kernel_version(void);
33#define LINUX_VERSION(x,y,z) (0x10000*(x) + 0x100*(y) + z)
34#define LINUX_VERSION_MAJOR(x) (((x)>>16) & 0xFF)
35#define LINUX_VERSION_MINOR(x) (((x)>> 8) & 0xFF)
36#define LINUX_VERSION_PATCH(x) ( (x) & 0xFF)
37
Marc Bouchere6869a82000-03-20 06:03:29 +000038#endif /*_IPTABLES_USER_H*/