blob: 84211c32f87be3c74727442757f7977e2da0498b [file] [log] [blame]
lh9ed821d2023-04-07 01:36:19 -07001#ifndef _IPTABLES_USER_H
2#define _IPTABLES_USER_H
3
4#include <netinet/ip.h>
5#include <xtables.h>
6#include <libiptc/libiptc.h>
7#include <iptables/internal.h>
8
9/* Your shared library should call one of these. */
10extern int do_command(int argc, char *argv[], char **table,
11 struct iptc_handle **handle);
12extern int delete_chain(const ipt_chainlabel chain, int verbose,
13 struct iptc_handle *handle);
14extern int flush_entries(const ipt_chainlabel chain, int verbose,
15 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);
18extern void print_rule(const struct ipt_entry *e,
19 struct iptc_handle *handle, const char *chain, int counters);
20
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
29extern struct xtables_globals iptables_globals;
30
31#endif /*_IPTABLES_USER_H*/