libipt_MIRROR.c revision ea146a982e26c42f9954f140276f8deeb2edbe98
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
19/* Initialize the target. */
20static void
21init(struct xt_entry_target *t)
22{
23}
24
25/* Function which parses command options; returns true if it
26   ate an option */
27static int
28parse(int c, char **argv, int invert, unsigned int *flags,
29      const void *entry,
30      struct xt_entry_target **target)
31{
32	return 0;
33}
34
35static void
36final_check(unsigned int flags)
37{
38}
39
40static struct iptables_target mirror = {
41	.name		= "MIRROR",
42	.version	= IPTABLES_VERSION,
43	.size		= IPT_ALIGN(0),
44	.userspacesize	= IPT_ALIGN(0),
45 	.help		= &help,
46	.init		= &init,
47 	.parse		= &parse,
48	.final_check 	= &final_check,
49	.print		= NULL,
50	.save		= NULL,
51};
52
53void _init(void)
54{
55	register_target(&mirror);
56}
57