aboutsummaryrefslogtreecommitdiffstats
path: root/tools/remus/kmod/ebt_imq.c
blob: 7f8847cb9b4316ea5982a127204bc5e7fc04766e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#include <linux/module.h>
#include <linux/skbuff.h>
#include <linux/netfilter_bridge/ebtables.h>
#include <linux/netdevice.h>
#include "ebt_imq.h"

static int ebt_target_imq(struct sk_buff **pskb, unsigned int hooknr,
   const struct net_device *in, const struct net_device *out,
   const void *data, unsigned int datalen)
{
  struct ebt_imq_info *info = (struct ebt_imq_info *) data;

  (*pskb)->imq_flags = info->todev | IMQ_F_ENQUEUE;

  return EBT_CONTINUE;
}

static int ebt_target_imq_check(const char *tablename, unsigned int hookmask,
   const struct ebt_entry *e, void *data, unsigned int datalen)
{
  return 0;
}

static struct ebt_target imq_target =
{
  .name                = "imq",
  .target       = ebt_target_imq,
  .check       = ebt_target_imq_check,
  .me          = THIS_MODULE,
};

static int __init init(void)
{
  return ebt_register_target(&imq_target);
}

static void __exit fini(void)
{
  ebt_unregister_target(&imq_target);
}


module_init(init);
module_exit(fini);
MODULE_LICENSE("GPL");