~ubuntu-branches/ubuntu/vivid/xtables-addons/vivid-proposed

« back to all changes in this revision

Viewing changes to extensions/xt_STEAL.c

  • Committer: Package Import Robot
  • Author(s): Dmitry Smirnov
  • Date: 2014-02-10 13:05:36 UTC
  • mfrom: (1.3.12)
  • Revision ID: package-import@ubuntu.com-20140210130536-n4hxbw8397s4dj09
Tags: 2.4-1
* New upstream version [January 2014].
* Dropped no longer needed "skip-depmod.patch".
* Added "unzip, wget" to Recommends to satisfy `xt_geoip_dl`
  (Closes: #714654).
* Fixed FTBFS in m-a/xtables-addons-source (Closes: #730074).
* Standards to 3.9.5.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 *      "STEAL" demo target extension for Xtables
3
 
 *      written by Jan Engelhardt, 2008 - 2009
4
 
 *      placed in the Public Domain
5
 
 */
6
 
#include <linux/module.h>
7
 
#include <linux/netfilter.h>
8
 
#include <linux/skbuff.h>
9
 
#include "compat_xtables.h"
10
 
 
11
 
static unsigned int
12
 
steal_tg(struct sk_buff **pskb, const struct xt_action_param *par)
13
 
{
14
 
        kfree_skb(*pskb);
15
 
        return NF_STOLEN;
16
 
}
17
 
 
18
 
static struct xt_target steal_tg_reg[] __read_mostly = {
19
 
        {
20
 
                .name     = "STEAL",
21
 
                .revision = 0,
22
 
                .family   = NFPROTO_UNSPEC,
23
 
                .target   = steal_tg,
24
 
                .me       = THIS_MODULE,
25
 
        },
26
 
        {
27
 
                .name     = "STEAL",
28
 
                .revision = 0,
29
 
                .family   = NFPROTO_IPV6,
30
 
                .target   = steal_tg,
31
 
                .me       = THIS_MODULE,
32
 
        },
33
 
        {
34
 
                .name     = "STEAL",
35
 
                .revision = 0,
36
 
                .family   = NFPROTO_ARP,
37
 
                .target   = steal_tg,
38
 
                .me       = THIS_MODULE,
39
 
        },
40
 
        {
41
 
                .name     = "STEAL",
42
 
                .revision = 0,
43
 
                .family   = NFPROTO_BRIDGE,
44
 
                .target   = steal_tg,
45
 
                .me       = THIS_MODULE,
46
 
        },
47
 
};
48
 
 
49
 
static int __init steal_tg_init(void)
50
 
{
51
 
        return xt_register_targets(steal_tg_reg, ARRAY_SIZE(steal_tg_reg));
52
 
}
53
 
 
54
 
static void __exit steal_tg_exit(void)
55
 
{
56
 
        xt_unregister_targets(steal_tg_reg, ARRAY_SIZE(steal_tg_reg));
57
 
}
58
 
 
59
 
module_init(steal_tg_init);
60
 
module_exit(steal_tg_exit);
61
 
MODULE_AUTHOR("Jan Engelhardt ");
62
 
MODULE_DESCRIPTION("Xtables: Silently DROP packets on output chain");
63
 
MODULE_LICENSE("GPL");
64
 
MODULE_ALIAS("ipt_STEAL");
65
 
MODULE_ALIAS("ip6t_STEAL");
66
 
MODULE_ALIAS("arpt_STEAL");
67
 
MODULE_ALIAS("ebt_STEAL");