]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - net/bridge/netfilter/ebt_ulog.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/wim/linux-2.6-nvram
[linux-2.6-omap-h63xx.git] / net / bridge / netfilter / ebt_ulog.c
index e13a005f58ad361fd945dc69e2a259b9ca56ab5b..2c6d6823e703dd62d226a30b740c50fab79615c7 100644 (file)
@@ -246,19 +246,17 @@ static void ebt_log_packet(u_int8_t pf, unsigned int hooknum,
        ebt_ulog_packet(hooknum, skb, in, out, &loginfo, prefix);
 }
 
-static void ebt_ulog(const struct sk_buff *skb, unsigned int hooknr,
-   const struct net_device *in, const struct net_device *out,
-   const void *data, unsigned int datalen)
+static unsigned int
+ebt_ulog_tg(struct sk_buff *skb, const struct xt_target_param *par)
 {
-       const struct ebt_ulog_info *uloginfo = data;
-
-       ebt_ulog_packet(hooknr, skb, in, out, uloginfo, NULL);
+       ebt_ulog_packet(par->hooknum, skb, par->in, par->out,
+                       par->targinfo, NULL);
+       return EBT_CONTINUE;
 }
 
-static bool ebt_ulog_check(const char *tablename, unsigned int hookmask,
-   const struct ebt_entry *e, void *data, unsigned int datalen)
+static bool ebt_ulog_tg_check(const struct xt_tgchk_param *par)
 {
-       struct ebt_ulog_info *uloginfo = data;
+       struct ebt_ulog_info *uloginfo = par->targinfo;
 
        if (uloginfo->nlgroup > 31)
                return false;
@@ -271,16 +269,18 @@ static bool ebt_ulog_check(const char *tablename, unsigned int hookmask,
        return 0;
 }
 
-static struct ebt_watcher ulog __read_mostly = {
-       .name           = EBT_ULOG_WATCHER,
-       .watcher        = ebt_ulog,
-       .check          = ebt_ulog_check,
+static struct xt_target ebt_ulog_tg_reg __read_mostly = {
+       .name           = "ulog",
+       .revision       = 0,
+       .family         = NFPROTO_BRIDGE,
+       .target         = ebt_ulog_tg,
+       .checkentry     = ebt_ulog_tg_check,
        .targetsize     = XT_ALIGN(sizeof(struct ebt_ulog_info)),
        .me             = THIS_MODULE,
 };
 
 static const struct nf_logger ebt_ulog_logger = {
-       .name           = EBT_ULOG_WATCHER,
+       .name           = "ulog",
        .logfn          = &ebt_log_packet,
        .me             = THIS_MODULE,
 };
@@ -309,7 +309,7 @@ static int __init ebt_ulog_init(void)
                printk(KERN_WARNING KBUILD_MODNAME ": out of memory trying to "
                       "call netlink_kernel_create\n");
                ret = false;
-       } else if (ebt_register_watcher(&ulog) != 0) {
+       } else if (xt_register_target(&ebt_ulog_tg_reg) != 0) {
                netlink_kernel_release(ebtulognl);
        }
 
@@ -325,7 +325,7 @@ static void __exit ebt_ulog_fini(void)
        int i;
 
        nf_log_unregister(&ebt_ulog_logger);
-       ebt_unregister_watcher(&ulog);
+       xt_unregister_target(&ebt_ulog_tg_reg);
        for (i = 0; i < EBT_ULOG_MAXNLGROUPS; i++) {
                ub = &ulog_buffers[i];
                if (timer_pending(&ub->timer))