iptables-1.2.9-2.3.1.src.rpm
[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 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 static
56 struct iptables_match record_rpc
57 = { NULL,
58     "record_rpc",
59     IPTABLES_VERSION,
60     IPT_ALIGN(0),
61     IPT_ALIGN(0),
62     &help,
63     &init,
64     &parse,
65     &final_check,
66     &print,
67     &save,
68     opts
69 };
70
71 void _init(void)
72 {
73         register_match(&record_rpc);
74 }