Yasuyuki KOZAKAI | 1a31b42 | 2007-08-04 08:22:03 +0000 | [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 | /* Function which prints out usage message. */ |
| 11 | static void |
| 12 | help(void) |
| 13 | { |
| 14 | printf( |
| 15 | "TRACE target v%s takes no options\n", |
| 16 | IPTABLES_VERSION); |
| 17 | } |
| 18 | |
Yasuyuki KOZAKAI | 1a31b42 | 2007-08-04 08:22:03 +0000 | [diff] [blame] | 19 | /* Function which parses command options; returns true if it |
| 20 | ate an option */ |
| 21 | static int |
| 22 | parse(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 | |
Yasuyuki KOZAKAI | 1a31b42 | 2007-08-04 08:22:03 +0000 | [diff] [blame] | 29 | static 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, |
Yasuyuki KOZAKAI | 1a31b42 | 2007-08-04 08:22:03 +0000 | [diff] [blame] | 36 | .parse = &parse, |
Yasuyuki KOZAKAI | 1a31b42 | 2007-08-04 08:22:03 +0000 | [diff] [blame] | 37 | }; |
| 38 | |
| 39 | static struct xtables_target trace6 = { |
| 40 | .family = AF_INET6, |
| 41 | .name = "TRACE", |
| 42 | .version = IPTABLES_VERSION, |
| 43 | .size = XT_ALIGN(0), |
| 44 | .userspacesize = XT_ALIGN(0), |
| 45 | .help = &help, |
Yasuyuki KOZAKAI | 1a31b42 | 2007-08-04 08:22:03 +0000 | [diff] [blame] | 46 | .parse = &parse, |
Yasuyuki KOZAKAI | 1a31b42 | 2007-08-04 08:22:03 +0000 | [diff] [blame] | 47 | }; |
| 48 | |
| 49 | void _init(void) |
| 50 | { |
| 51 | xtables_register_target(&trace); |
| 52 | xtables_register_target(&trace6); |
| 53 | } |