iptables-1.3.2-20050720
[iptables.git] / extensions / libipt_record_rpc.c
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", IPTABLES_VERSION);
13 }
14
15 static struct option opts[] = {
16         {0}
17 };
18
19 /* Function which parses command options; returns true if it
20    ate an option */
21 static int
22 parse(int c, char **argv, int invert, unsigned int *flags,
23       const struct ipt_entry *entry,
24       unsigned int *nfcache,
25       struct ipt_entry_match **match)
26 {
27         return 0;
28 }
29
30 /* Final check; must have specified --mac. */
31 static void final_check(unsigned int flags)
32 {
33 }
34
35 /* Prints out the union ipt_matchinfo. */
36 static void
37 print(const struct ipt_ip *ip,
38       const struct ipt_entry_match *match,
39       int numeric)
40 {
41 }
42
43 static void save(const struct ipt_ip *ip, const struct ipt_entry_match *match)
44 {
45 }
46
47 static
48 struct iptables_match record_rpc = { 
49         .next           = NULL,
50         .name           = "record_rpc",
51         .version        = IPTABLES_VERSION,
52         .size           = IPT_ALIGN(0),
53         .userspacesize  = IPT_ALIGN(0),
54         .help           = &help,
55         .parse          = &parse,
56         .final_check    = &final_check,
57         .print          = &print,
58         .save           = &save,
59         .extra_opts     = opts
60 };
61
62 void _init(void)
63 {
64         register_match(&record_rpc);
65 }