libxt_TRACE.c revision 830132ac9c0d270bf9dcfe85c2464e3fe8c73fb9
1/* Shared library add-on to iptables to add TRACE target support. */
2#include <stdio.h>
3#include <string.h>
4#include <stdlib.h>
5#include <getopt.h>
6
7#include <xtables.h>
8#include <linux/netfilter/x_tables.h>
9
10/* Function which prints out usage message. */
11static void
12help(void)
13{
14	printf(
15"TRACE target v%s takes no options\n",
16IPTABLES_VERSION);
17}
18
19/* Function which parses command options; returns true if it
20   ate an option */
21static int
22parse(int c, char **argv, int invert, unsigned int *flags,
23      const void *entry,
24      struct xt_entry_target **target)
25{
26	return 0;
27}
28
29static struct xtables_target trace = {
30	.family		= AF_INET,
31	.name		= "TRACE",
32	.version	= IPTABLES_VERSION,
33	.size		= XT_ALIGN(0),
34	.userspacesize	= XT_ALIGN(0),
35	.help		= &help,
36	.parse		= &parse,
37	.print		= NULL, /* print */
38	.save		= NULL, /* save */
39};
40
41static struct xtables_target trace6 = {
42	.family		= AF_INET6,
43	.name		= "TRACE",
44	.version	= IPTABLES_VERSION,
45	.size		= XT_ALIGN(0),
46	.userspacesize	= XT_ALIGN(0),
47	.help		= &help,
48	.parse		= &parse,
49	.print		= NULL, /* print */
50	.save		= NULL, /* save */
51};
52
53void _init(void)
54{
55	xtables_register_target(&trace);
56	xtables_register_target(&trace6);
57}
58