libipt_MIRROR.c revision 18992db3bfdb3b695cae12b53434f560cbf8e2ae
1/* Shared library add-on to iptables to add MIRROR target support. */
2#include <stdio.h>
3#include <string.h>
4#include <stdlib.h>
5#include <getopt.h>
6
7#include <iptables.h>
8#include <linux/netfilter_ipv4/ip_tables.h>
9
10/* Function which prints out usage message. */
11static void
12help(void)
13{
14	printf(
15"MIRROR target v%s takes no options\n",
16IPTABLES_VERSION);
17}
18
19static struct option opts[] = {
20	{ 0 }
21};
22
23/* Initialize the target. */
24static void
25init(struct xt_entry_target *t, unsigned int *nfcache)
26{
27}
28
29/* Function which parses command options; returns true if it
30   ate an option */
31static int
32parse(int c, char **argv, int invert, unsigned int *flags,
33      const void *entry,
34      struct xt_entry_target **target)
35{
36	return 0;
37}
38
39static void
40final_check(unsigned int flags)
41{
42}
43
44static struct iptables_target mirror = {
45	.name		= "MIRROR",
46	.version	= IPTABLES_VERSION,
47	.size		= IPT_ALIGN(0),
48	.userspacesize	= IPT_ALIGN(0),
49 	.help		= &help,
50	.init		= &init,
51 	.parse		= &parse,
52	.final_check 	= &final_check,
53	.print		= NULL,
54	.save		= NULL,
55	.extra_opts	= opts
56};
57
58void _init(void)
59{
60	register_target(&mirror);
61}
62