blob: 84211c32f87be3c74727442757f7977e2da0498b [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>
Jan Engelhardtc02e8082009-02-10 10:40:15 +01007#include <iptables/internal.h>
Marc Bouchere6869a82000-03-20 06:03:29 +00008
Marc Bouchere6869a82000-03-20 06:03:29 +00009/* Your shared library should call one of these. */
Marc Bouchere6869a82000-03-20 06:03:29 +000010extern int do_command(int argc, char *argv[], char **table,
Jan Engelhardtfd187312008-11-10 16:59:27 +010011 struct iptc_handle **handle);
Harald Weltea114e9e2000-12-01 14:28:19 +000012extern int delete_chain(const ipt_chainlabel chain, int verbose,
Jan Engelhardt1c9015b2008-11-10 17:00:41 +010013 struct iptc_handle *handle);
Harald Weltea114e9e2000-12-01 14:28:19 +000014extern int flush_entries(const ipt_chainlabel chain, int verbose,
Jan Engelhardt1c9015b2008-11-10 17:00:41 +010015 struct iptc_handle *handle);
16extern int for_each_chain(int (*fn)(const ipt_chainlabel, int, struct iptc_handle *),
17 int verbose, int builtinstoo, struct iptc_handle *handle);
Henrik Nordstrom96296cf2008-05-13 13:08:26 +020018extern void print_rule(const struct ipt_entry *e,
Jan Engelhardt1c9015b2008-11-10 17:00:41 +010019 struct iptc_handle *handle, const char *chain, int counters);
Phil Oester8cf65912005-09-19 15:00:33 +000020
21/* kernel revision handling */
22extern int kernel_version;
23extern void get_kernel_version(void);
24#define LINUX_VERSION(x,y,z) (0x10000*(x) + 0x100*(y) + z)
25#define LINUX_VERSION_MAJOR(x) (((x)>>16) & 0xFF)
26#define LINUX_VERSION_MINOR(x) (((x)>> 8) & 0xFF)
27#define LINUX_VERSION_PATCH(x) ( (x) & 0xFF)
28
Jamal Hadi Salim617d3d12009-02-11 16:28:31 -050029extern struct xtables_globals iptables_globals;
30
Marc Bouchere6869a82000-03-20 06:03:29 +000031#endif /*_IPTABLES_USER_H*/