Rusty Russell | 51d9b75 | 2000-08-27 07:44:59 +0000 | [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 <iptables.h> |
| 8 | #include <linux/netfilter_ipv4/ip_tables.h> |
| 9 | |
| 10 | /* Function which prints out usage message. */ |
| 11 | static void |
| 12 | help(void) |
| 13 | { |
| 14 | printf( |
| 15 | "MIRROR target v%s takes no options\n", |
Harald Welte | 80fe35d | 2002-05-29 13:08:15 +0000 | [diff] [blame] | 16 | IPTABLES_VERSION); |
Rusty Russell | 51d9b75 | 2000-08-27 07:44:59 +0000 | [diff] [blame] | 17 | } |
| 18 | |
| 19 | static struct option opts[] = { |
| 20 | { 0 } |
| 21 | }; |
| 22 | |
| 23 | /* Initialize the target. */ |
| 24 | static void |
| 25 | init(struct ipt_entry_target *t, unsigned int *nfcache) |
| 26 | { |
| 27 | } |
| 28 | |
| 29 | /* Function which parses command options; returns true if it |
| 30 | ate an option */ |
| 31 | static int |
| 32 | parse(int c, char **argv, int invert, unsigned int *flags, |
| 33 | const struct ipt_entry *entry, |
| 34 | struct ipt_entry_target **target) |
| 35 | { |
| 36 | return 0; |
| 37 | } |
| 38 | |
| 39 | static void |
| 40 | final_check(unsigned int flags) |
| 41 | { |
| 42 | } |
| 43 | |
Pablo Neira | 8caee8b | 2004-12-28 13:11:59 +0000 | [diff] [blame] | 44 | static struct iptables_target mirror = { |
| 45 | .next = NULL, |
| 46 | .name = "MIRROR", |
| 47 | .version = IPTABLES_VERSION, |
| 48 | .size = IPT_ALIGN(0), |
| 49 | .userspacesize = IPT_ALIGN(0), |
| 50 | .help = &help, |
| 51 | .init = &init, |
| 52 | .parse = &parse, |
| 53 | .final_check = &final_check, |
| 54 | .print = NULL, |
| 55 | .save = NULL, |
| 56 | .extra_opts = opts |
Rusty Russell | 51d9b75 | 2000-08-27 07:44:59 +0000 | [diff] [blame] | 57 | }; |
| 58 | |
| 59 | void _init(void) |
| 60 | { |
| 61 | register_target(&mirror); |
| 62 | } |