lh | 9ed821d | 2023-04-07 01:36:19 -0700 | [diff] [blame^] | 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 | static void TRACE_help(void) |
| 11 | { |
| 12 | printf("TRACE target takes no options\n"); |
| 13 | } |
| 14 | |
| 15 | static int TRACE_parse(int c, char **argv, int invert, unsigned int *flags, |
| 16 | const void *entry, struct xt_entry_target **target) |
| 17 | { |
| 18 | return 0; |
| 19 | } |
| 20 | |
| 21 | static struct xtables_target trace_target = { |
| 22 | .family = AF_UNSPEC, |
| 23 | .name = "TRACE", |
| 24 | .version = XTABLES_VERSION, |
| 25 | .size = XT_ALIGN(0), |
| 26 | .userspacesize = XT_ALIGN(0), |
| 27 | .help = TRACE_help, |
| 28 | .parse = TRACE_parse, |
| 29 | }; |
| 30 | |
| 31 | void _init(void) |
| 32 | { |
| 33 | xtables_register_target(&trace_target); |
| 34 | } |