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