• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 
trace_xlate(struct xt_xlate * xl,const struct xt_xlate_tg_params * params)10 static int trace_xlate(struct xt_xlate *xl,
11 		       const struct xt_xlate_tg_params *params)
12 {
13 	xt_xlate_add(xl, "nftrace set 1");
14 	return 1;
15 }
16 
17 static struct xtables_target trace_target = {
18 	.family		= NFPROTO_UNSPEC,
19 	.name		= "TRACE",
20 	.version	= XTABLES_VERSION,
21 	.size		= XT_ALIGN(0),
22 	.userspacesize	= XT_ALIGN(0),
23 	.xlate		= trace_xlate,
24 };
25 
_init(void)26 void _init(void)
27 {
28 	xtables_register_target(&trace_target);
29 }
30