blob: ecc7168fdd3ed02c3df85cc2c9f94a44b1a6ddd1 [file] [log] [blame]
Marc Bouchere6869a82000-03-20 06:03:29 +00001#ifndef _IPTABLES_USER_H
2#define _IPTABLES_USER_H
3
Yasuyuki KOZAKAI0d502bc2007-07-24 05:52:07 +00004#include "xtables.h"
Marc Bouchere6869a82000-03-20 06:03:29 +00005#include "libiptc/libiptc.h"
6
Rusty Russell3aef54d2005-01-03 03:48:40 +00007#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 Russell3aef54d2005-01-03 03:48:40 +000010#endif /* IPT_SO_GET_REVISION_MATCH Old kernel source */
11
Yasuyuki KOZAKAI0d502bc2007-07-24 05:52:07 +000012#define iptables_rule_match xtables_rule_match
Yasuyuki KOZAKAI0d502bc2007-07-24 05:52:07 +000013#define ipt_tryload xt_tryload
Marc Bouchere6869a82000-03-20 06:03:29 +000014
Illes Marci63e90632003-03-03 08:08:37 +000015extern int line;
16
Marc Bouchere6869a82000-03-20 06:03:29 +000017/* Your shared library should call one of these. */
Marc Bouchere6869a82000-03-20 06:03:29 +000018extern int do_command(int argc, char *argv[], char **table,
19 iptc_handle_t *handle);
Harald Weltea114e9e2000-12-01 14:28:19 +000020extern int delete_chain(const ipt_chainlabel chain, int verbose,
21 iptc_handle_t *handle);
22extern int flush_entries(const ipt_chainlabel chain, int verbose,
23 iptc_handle_t *handle);
24extern int for_each_chain(int (*fn)(const ipt_chainlabel, int, iptc_handle_t *),
25 int verbose, int builtinstoo, iptc_handle_t *handle);
Henrik Nordstrom96296cf2008-05-13 13:08:26 +020026extern void print_rule(const struct ipt_entry *e,
27 iptc_handle_t *handle, const char *chain, int counters);
Phil Oester8cf65912005-09-19 15:00:33 +000028
29/* kernel revision handling */
30extern int kernel_version;
31extern 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 Bouchere6869a82000-03-20 06:03:29 +000037#endif /*_IPTABLES_USER_H*/