[NET] IPV4: Fix whitespace errors.
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / net / ipv4 / netfilter / ipt_ttl.c
index 82da53f430ab27d0b35e74220525434876fa5001..1eca9f40037493b69a025f16f016d070c536b91d 100644 (file)
@@ -1,4 +1,4 @@
-/* IP tables module for matching the value of the TTL 
+/* IP tables module for matching the value of the TTL
  *
  * ipt_ttl.c,v 1.5 2000/11/13 11:16:08 laforge Exp
  *
@@ -9,18 +9,20 @@
  * published by the Free Software Foundation.
  */
 
+#include <linux/ip.h>
 #include <linux/module.h>
 #include <linux/skbuff.h>
 
 #include <linux/netfilter_ipv4/ipt_ttl.h>
-#include <linux/netfilter_ipv4/ip_tables.h>
+#include <linux/netfilter/x_tables.h>
 
 MODULE_AUTHOR("Harald Welte <laforge@netfilter.org>");
 MODULE_DESCRIPTION("IP tables TTL matching module");
 MODULE_LICENSE("GPL");
 
-static int match(const struct sk_buff *skb, const struct net_device *in,
-                const struct net_device *out, const void *matchinfo,
+static int match(const struct sk_buff *skb,
+                const struct net_device *in, const struct net_device *out,
+                const struct xt_match *match, const void *matchinfo,
                 int offset, unsigned int protoff, int *hotdrop)
 {
        const struct ipt_ttl_info *info = matchinfo;
@@ -39,7 +41,7 @@ static int match(const struct sk_buff *skb, const struct net_device *in,
                        return (skb->nh.iph->ttl > info->ttl);
                        break;
                default:
-                       printk(KERN_WARNING "ipt_ttl: unknown mode %d\n", 
+                       printk(KERN_WARNING "ipt_ttl: unknown mode %d\n",
                                info->mode);
                        return 0;
        }
@@ -47,33 +49,23 @@ static int match(const struct sk_buff *skb, const struct net_device *in,
        return 0;
 }
 
-static int checkentry(const char *tablename, const void  *ip,
-                     void *matchinfo, unsigned int matchsize,
-                     unsigned int hook_mask)
-{
-       if (matchsize != IPT_ALIGN(sizeof(struct ipt_ttl_info)))
-               return 0;
-
-       return 1;
-}
-
-static struct ipt_match ttl_match = {
+static struct xt_match ttl_match = {
        .name           = "ttl",
-       .match          = &match,
-       .checkentry     = &checkentry,
+       .family         = AF_INET,
+       .match          = match,
+       .matchsize      = sizeof(struct ipt_ttl_info),
        .me             = THIS_MODULE,
 };
 
-static int __init init(void)
+static int __init ipt_ttl_init(void)
 {
-       return ipt_register_match(&ttl_match);
+       return xt_register_match(&ttl_match);
 }
 
-static void __exit fini(void)
+static void __exit ipt_ttl_fini(void)
 {
-       ipt_unregister_match(&ttl_match);
-
+       xt_unregister_match(&ttl_match);
 }
 
-module_init(init);
-module_exit(fini);
+module_init(ipt_ttl_init);
+module_exit(ipt_ttl_fini);