3 Experimental Netfilter Crap
4 Copyright (C) 2006 Jonathan Zarate
14 #include <linux/netfilter_ipv4/ipt_exp.h>
17 static void help(void)
20 "exp match v0.00 options:\n"
21 " how should I know?!\n");
24 static void init(struct ipt_entry_match
*m
, unsigned int *nfcache
)
26 *nfcache
|= NFC_UNKNOWN
;
29 static struct option opts
[] = {
30 { .name
= "foo", .has_arg
= 0, .flag
= 0, .val
= '1' },
34 static int parse(int c
, char **argv
, int invert
, unsigned int *flags
,
35 const struct ipt_entry
*entry
, unsigned int *nfcache
,
36 struct ipt_entry_match
**match
)
38 struct ipt_exp_info
*info
;
40 if ((c
< '1') || (c
> '1')) return 0;
44 info
= (struct ipt_exp_info
*)(*match
)->data
;
47 info
->dummy
= 1; // blah
53 static void final_check(unsigned int flags
)
57 static void print(const struct ipt_ip
*ip
, const struct ipt_entry_match
*match
, int numeric
)
62 static void save(const struct ipt_ip
*ip
, const struct ipt_entry_match
*match
)
67 static struct iptables_match exp_match
= {
69 .version
= IPTABLES_VERSION
,
70 .size
= IPT_ALIGN(sizeof(struct ipt_exp_info
)),
71 .userspacesize
= IPT_ALIGN(sizeof(struct ipt_exp_info
)),
75 .final_check
= &final_check
,
83 register_match(&exp_match
);