iptables-1.2.9-2.3.1.src.rpm
[iptables.git] / extensions / libipt_TARPIT.c
1 /* Shared library add-on to iptables for TARPIT support */
2 #include <stdio.h>
3 #include <getopt.h>
4 #include <iptables.h>
5
6 static void
7 help(void)
8 {
9         fputs(
10 "TARPIT takes no options\n"
11 "\n", stdout);
12 }
13
14 static struct option opts[] = {
15         { 0 }
16 };
17
18 static void
19 init(struct ipt_entry_target *t, unsigned int *nfcache)
20 {
21         /* Can't cache this */
22         *nfcache |= NFC_UNKNOWN;
23 }
24
25 static int
26 parse(int c, char **argv, int invert, unsigned int *flags,
27       const struct ipt_entry *entry,
28       struct ipt_entry_target **target)
29 {
30         return 0;
31 }
32
33 static void final_check(unsigned int flags)
34 {
35 }
36
37 static void
38 print(const struct ipt_ip *ip,
39       const struct ipt_entry_target *target,
40       int numeric)
41 {
42 }
43
44 static void save(const struct ipt_ip *ip, const struct ipt_entry_target *target)
45 {
46 }
47
48 static
49 struct iptables_target tarpit
50 = { NULL,
51     "TARPIT",
52     IPTABLES_VERSION,
53     IPT_ALIGN(0),
54     IPT_ALIGN(0),
55     &help,
56     &init,
57     &parse,
58     &final_check,
59     &print,
60     &save,
61     opts
62 };
63
64 void _init(void)
65 {
66         register_target(&tarpit);
67 }