blob: 65b32909e4721c37f326fe66184239d8defe3fcb [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. */
Maciej Zenczykowskic1e04bd2011-04-04 15:38:11 +020010extern int do_command4(int argc, char *argv[], char **table,
Jan Engelhardtfd187312008-11-10 16:59:27 +010011 struct iptc_handle **handle);
Maciej Zenczykowskie5c061a2011-04-04 15:36:14 +020012extern int delete_chain4(const ipt_chainlabel chain, int verbose,
Jan Engelhardt1c9015b2008-11-10 17:00:41 +010013 struct iptc_handle *handle);
Maciej Zenczykowskicc38d052011-04-04 15:35:20 +020014extern int flush_entries4(const ipt_chainlabel chain, int verbose,
Jan Engelhardt1c9015b2008-11-10 17:00:41 +010015 struct iptc_handle *handle);
Maciej Zenczykowskie70844a2011-04-04 15:34:28 +020016extern int for_each_chain4(int (*fn)(const ipt_chainlabel, int, struct iptc_handle *),
Jan Engelhardt1c9015b2008-11-10 17:00:41 +010017 int verbose, int builtinstoo, struct iptc_handle *handle);
Maciej Zenczykowskibb9fe802011-04-04 15:37:13 +020018extern void print_rule4(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*/