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> |
| 8 | #include <iptables.h> |
| 9 | |
| 10 | /* Function which prints out usage message. */ |
| 11 | static void |
| 12 | help(void) |
| 13 | { |
| 14 | printf( |
| 15 | "Standard v%s options:\n" |
Harald Welte | 80fe35d | 2002-05-29 13:08:15 +0000 | [diff] [blame] | 16 | "(If target is DROP, ACCEPT, RETURN or nothing)\n", IPTABLES_VERSION); |
Marc Boucher | e6869a8 | 2000-03-20 06:03:29 +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 | /* Final check; don't care. */ |
| 40 | static void final_check(unsigned int flags) |
| 41 | { |
| 42 | } |
| 43 | |
| 44 | /* Saves the targinfo in parsable form to stdout. */ |
| 45 | static void |
| 46 | save(const struct ipt_ip *ip, const struct ipt_entry_target *target) |
| 47 | { |
| 48 | } |
| 49 | |
Harald Welte | 3efb6ea | 2001-08-06 18:50:21 +0000 | [diff] [blame] | 50 | static |
Pablo Neira | 8caee8b | 2004-12-28 13:11:59 +0000 | [diff] [blame] | 51 | struct iptables_target standard = { |
| 52 | .next = NULL, |
| 53 | .name = "standard", |
| 54 | .version = IPTABLES_VERSION, |
| 55 | .size = IPT_ALIGN(sizeof(int)), |
| 56 | .userspacesize = IPT_ALIGN(sizeof(int)), |
| 57 | .help = &help, |
| 58 | .init = &init, |
| 59 | .parse = &parse, |
| 60 | .final_check = &final_check, |
| 61 | .print = NULL, |
| 62 | .save = &save, |
| 63 | .extra_opts = opts |
Marc Boucher | e6869a8 | 2000-03-20 06:03:29 +0000 | [diff] [blame] | 64 | }; |
| 65 | |
| 66 | void _init(void) |
| 67 | { |
| 68 | register_target(&standard); |
| 69 | } |