tcp: fix inet_twsk_deschedule()
[linux-2.6/linux-acpi-2.6/ibm-acpi-2.6.git] / net / bridge / netfilter / ebt_pkttype.c
blob883e96e2a5420e133336930e88d678fd486ed972
1 /*
2 * ebt_pkttype
4 * Authors:
5 * Bart De Schuymer <bdschuym@pandora.be>
7 * April, 2003
9 */
10 #include <linux/module.h>
11 #include <linux/netfilter/x_tables.h>
12 #include <linux/netfilter_bridge/ebtables.h>
13 #include <linux/netfilter_bridge/ebt_pkttype.h>
15 static bool
16 ebt_pkttype_mt(const struct sk_buff *skb, const struct xt_match_param *par)
18 const struct ebt_pkttype_info *info = par->matchinfo;
20 return (skb->pkt_type == info->pkt_type) ^ info->invert;
23 static bool ebt_pkttype_mt_check(const struct xt_mtchk_param *par)
25 const struct ebt_pkttype_info *info = par->matchinfo;
27 if (info->invert != 0 && info->invert != 1)
28 return false;
29 /* Allow any pkt_type value */
30 return true;
33 static struct xt_match ebt_pkttype_mt_reg __read_mostly = {
34 .name = "pkttype",
35 .revision = 0,
36 .family = NFPROTO_BRIDGE,
37 .match = ebt_pkttype_mt,
38 .checkentry = ebt_pkttype_mt_check,
39 .matchsize = XT_ALIGN(sizeof(struct ebt_pkttype_info)),
40 .me = THIS_MODULE,
43 static int __init ebt_pkttype_init(void)
45 return xt_register_match(&ebt_pkttype_mt_reg);
48 static void __exit ebt_pkttype_fini(void)
50 xt_unregister_match(&ebt_pkttype_mt_reg);
53 module_init(ebt_pkttype_init);
54 module_exit(ebt_pkttype_fini);
55 MODULE_DESCRIPTION("Ebtables: Link layer packet type match");
56 MODULE_LICENSE("GPL");