| Marc Boucher | e6869a8 | 2000-03-20 06:03:29 +0000 | [diff] [blame] | 1 | /* Shared library add-on to iptables for standard target support. */ |
| 2 | #include <stdio.h> |
| 3 | #include <netdb.h> |
| 4 | #include <string.h> |
| 5 | #include <stdlib.h> |
| 6 | #include <limits.h> |
| 7 | #include <getopt.h> |
| Yasuyuki KOZAKAI | e72f60e | 2007-07-24 07:00:40 +0000 | [diff] [blame] | 8 | #include <xtables.h> |
| Marc Boucher | e6869a8 | 2000-03-20 06:03:29 +0000 | [diff] [blame] | 9 | |
| 10 | /* Function which prints out usage message. */ |
| Jan Engelhardt | 181dead | 2007-10-04 16:27:07 +0000 | [diff] [blame] | 11 | static void standard_help(void) |
| Marc Boucher | e6869a8 | 2000-03-20 06:03:29 +0000 | [diff] [blame] | 12 | { |
| 13 | printf( |
| 14 | "Standard v%s options:\n" |
| Harald Welte | 80fe35d | 2002-05-29 13:08:15 +0000 | [diff] [blame] | 15 | "(If target is DROP, ACCEPT, RETURN or nothing)\n", IPTABLES_VERSION); |
| Marc Boucher | e6869a8 | 2000-03-20 06:03:29 +0000 | [diff] [blame] | 16 | } |
| 17 | |
| Marc Boucher | e6869a8 | 2000-03-20 06:03:29 +0000 | [diff] [blame] | 18 | /* Function which parses command options; returns true if it |
| 19 | ate an option */ |
| Jan Engelhardt | 181dead | 2007-10-04 16:27:07 +0000 | [diff] [blame] | 20 | static int standard_parse(int c, char **argv, int invert, unsigned int *flags, |
| 21 | const void *entry, struct xt_entry_target **target) |
| Marc Boucher | e6869a8 | 2000-03-20 06:03:29 +0000 | [diff] [blame] | 22 | { |
| 23 | return 0; |
| 24 | } |
| 25 | |
| Jan Engelhardt | 181dead | 2007-10-04 16:27:07 +0000 | [diff] [blame] | 26 | static struct xtables_target standard_target = { |
| Jan Engelhardt | 23545c2 | 2008-02-14 04:23:04 +0100 | [diff] [blame^] | 27 | .family = AF_UNSPEC, |
| Yasuyuki KOZAKAI | e72f60e | 2007-07-24 07:00:40 +0000 | [diff] [blame] | 28 | .name = "standard", |
| 29 | .version = IPTABLES_VERSION, |
| 30 | .size = XT_ALIGN(sizeof(int)), |
| 31 | .userspacesize = XT_ALIGN(sizeof(int)), |
| Jan Engelhardt | 181dead | 2007-10-04 16:27:07 +0000 | [diff] [blame] | 32 | .help = standard_help, |
| 33 | .parse = standard_parse, |
| Marc Boucher | e6869a8 | 2000-03-20 06:03:29 +0000 | [diff] [blame] | 34 | }; |
| 35 | |
| 36 | void _init(void) |
| 37 | { |
| Jan Engelhardt | 181dead | 2007-10-04 16:27:07 +0000 | [diff] [blame] | 38 | xtables_register_target(&standard_target); |
| Marc Boucher | e6869a8 | 2000-03-20 06:03:29 +0000 | [diff] [blame] | 39 | } |