libxt_TRACE.c revision 0463ee1f28946cc49815737daa0ced0c68f39f0b
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 void
30final_check(unsigned int flags)
31{
32}
33
34static struct xtables_target trace = {
35	.family		= AF_INET,
36	.name		= "TRACE",
37	.version	= IPTABLES_VERSION,
38	.size		= XT_ALIGN(0),
39	.userspacesize	= XT_ALIGN(0),
40	.help		= &help,
41	.parse		= &parse,
42	.final_check	= &final_check,
43	.print		= NULL, /* print */
44	.save		= NULL, /* save */
45};
46
47static struct xtables_target trace6 = {
48	.family		= AF_INET6,
49	.name		= "TRACE",
50	.version	= IPTABLES_VERSION,
51	.size		= XT_ALIGN(0),
52	.userspacesize	= XT_ALIGN(0),
53	.help		= &help,
54	.parse		= &parse,
55	.final_check	= &final_check,
56	.print		= NULL, /* print */
57	.save		= NULL, /* save */
58};
59
60void _init(void)
61{
62	xtables_register_target(&trace);
63	xtables_register_target(&trace6);
64}
65