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 | |
Jan Engelhardt | 181dead | 2007-10-04 16:27:07 +0000 | [diff] [blame] | 10 | static void standard_help(void) |
Marc Boucher | e6869a8 | 2000-03-20 06:03:29 +0000 | [diff] [blame] | 11 | { |
| 12 | printf( |
Jan Engelhardt | 8b7c64d | 2008-04-15 11:48:25 +0200 | [diff] [blame] | 13 | "standard match options:\n" |
| 14 | "(If target is DROP, ACCEPT, RETURN or nothing)\n"); |
Marc Boucher | e6869a8 | 2000-03-20 06:03:29 +0000 | [diff] [blame] | 15 | } |
| 16 | |
Jan Engelhardt | 181dead | 2007-10-04 16:27:07 +0000 | [diff] [blame] | 17 | static int standard_parse(int c, char **argv, int invert, unsigned int *flags, |
| 18 | const void *entry, struct xt_entry_target **target) |
Marc Boucher | e6869a8 | 2000-03-20 06:03:29 +0000 | [diff] [blame] | 19 | { |
| 20 | return 0; |
| 21 | } |
| 22 | |
Jan Engelhardt | 181dead | 2007-10-04 16:27:07 +0000 | [diff] [blame] | 23 | static struct xtables_target standard_target = { |
Jan Engelhardt | 23545c2 | 2008-02-14 04:23:04 +0100 | [diff] [blame] | 24 | .family = AF_UNSPEC, |
Yasuyuki KOZAKAI | e72f60e | 2007-07-24 07:00:40 +0000 | [diff] [blame] | 25 | .name = "standard", |
Jan Engelhardt | 8b7c64d | 2008-04-15 11:48:25 +0200 | [diff] [blame] | 26 | .version = XTABLES_VERSION, |
Yasuyuki KOZAKAI | e72f60e | 2007-07-24 07:00:40 +0000 | [diff] [blame] | 27 | .size = XT_ALIGN(sizeof(int)), |
| 28 | .userspacesize = XT_ALIGN(sizeof(int)), |
Jan Engelhardt | 181dead | 2007-10-04 16:27:07 +0000 | [diff] [blame] | 29 | .help = standard_help, |
| 30 | .parse = standard_parse, |
Marc Boucher | e6869a8 | 2000-03-20 06:03:29 +0000 | [diff] [blame] | 31 | }; |
| 32 | |
| 33 | void _init(void) |
| 34 | { |
Jan Engelhardt | 181dead | 2007-10-04 16:27:07 +0000 | [diff] [blame] | 35 | xtables_register_target(&standard_target); |
Marc Boucher | e6869a8 | 2000-03-20 06:03:29 +0000 | [diff] [blame] | 36 | } |