lh | 9ed821d | 2023-04-07 01:36:19 -0700 | [diff] [blame] | 1 | /* Shared library add-on to iptables to add MIRROR target support. */ |
| 2 | #include <stdio.h> |
| 3 | #include <string.h> |
| 4 | #include <stdlib.h> |
| 5 | #include <getopt.h> |
| 6 | |
| 7 | #include <xtables.h> |
| 8 | |
| 9 | static void MIRROR_help(void) |
| 10 | { |
| 11 | printf("MIRROR target takes no options\n"); |
| 12 | } |
| 13 | |
| 14 | static int MIRROR_parse(int c, char **argv, int invert, unsigned int *flags, |
| 15 | const void *entry, struct xt_entry_target **target) |
| 16 | { |
| 17 | return 0; |
| 18 | } |
| 19 | |
| 20 | static struct xtables_target mirror_tg_reg = { |
| 21 | .name = "MIRROR", |
| 22 | .version = XTABLES_VERSION, |
| 23 | .family = NFPROTO_IPV4, |
| 24 | .size = XT_ALIGN(0), |
| 25 | .userspacesize = XT_ALIGN(0), |
| 26 | .help = MIRROR_help, |
| 27 | .parse = MIRROR_parse, |
| 28 | .print = NULL, |
| 29 | .save = NULL, |
| 30 | }; |
| 31 | |
| 32 | void _init(void) |
| 33 | { |
| 34 | xtables_register_target(&mirror_tg_reg); |
| 35 | } |