Marc Boucher | e6869a8 | 2000-03-20 06:03:29 +0000 | [diff] [blame] | 1 | /* Shared library add-on to iptables for unclean. */ |
| 2 | #include <stdio.h> |
| 3 | #include <stdlib.h> |
| 4 | #include <getopt.h> |
| 5 | #include <iptables.h> |
| 6 | |
| 7 | /* Function which prints out usage message. */ |
| 8 | static void |
| 9 | help(void) |
| 10 | { |
| 11 | printf( |
| 12 | "unclean v%s takes no options\n" |
| 13 | "\n", NETFILTER_VERSION); |
| 14 | } |
| 15 | |
| 16 | static struct option opts[] = { |
| 17 | {0} |
| 18 | }; |
| 19 | |
| 20 | /* Initialize the match. */ |
| 21 | static void |
| 22 | init(struct ipt_entry_match *m, unsigned int *nfcache) |
| 23 | { |
| 24 | /* Can't cache this. */ |
| 25 | *nfcache |= NFC_UNKNOWN; |
| 26 | } |
| 27 | |
| 28 | /* Function which parses command options; returns true if it |
| 29 | ate an option */ |
| 30 | static int |
| 31 | parse(int c, char **argv, int invert, unsigned int *flags, |
| 32 | const struct ipt_entry *entry, |
| 33 | unsigned int *nfcache, |
| 34 | struct ipt_entry_match **match) |
| 35 | { |
| 36 | return 0; |
| 37 | } |
| 38 | |
| 39 | /* Final check; must have specified --mac. */ |
| 40 | static void final_check(unsigned int flags) |
| 41 | { |
| 42 | } |
| 43 | |
| 44 | /* Saves the union ipt_matchinfo in parsable form to stdout. */ |
| 45 | static void save(const struct ipt_ip *ip, const struct ipt_entry_match *match) |
| 46 | { |
| 47 | } |
| 48 | |
| 49 | struct iptables_match unclean |
| 50 | = { NULL, |
| 51 | "unclean", |
| 52 | NETFILTER_VERSION, |
| 53 | 0, |
Rusty Russell | edf14cf | 2000-04-19 11:26:44 +0000 | [diff] [blame] | 54 | 0, |
Marc Boucher | e6869a8 | 2000-03-20 06:03:29 +0000 | [diff] [blame] | 55 | &help, |
| 56 | &init, |
| 57 | &parse, |
| 58 | &final_check, |
| 59 | NULL, /* print */ |
| 60 | &save, |
| 61 | opts |
| 62 | }; |
| 63 | |
| 64 | void _init(void) |
| 65 | { |
| 66 | register_match(&unclean); |
| 67 | } |