Release 4.11 net/netfilter/xt_mark.c
/*
* xt_mark - Netfilter module to match NFMARK value
*
* (C) 1999-2001 Marc Boucher <marc@mbsi.ca>
* Copyright © CC Computer Consultants GmbH, 2007 - 2008
* Jan Engelhardt <jengelh@medozas.de>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
#include <linux/module.h>
#include <linux/skbuff.h>
#include <linux/netfilter/xt_mark.h>
#include <linux/netfilter/x_tables.h>
MODULE_LICENSE("GPL");
MODULE_AUTHOR("Marc Boucher <marc@mbsi.ca>");
MODULE_DESCRIPTION("Xtables: packet mark operations");
MODULE_ALIAS("ipt_mark");
MODULE_ALIAS("ip6t_mark");
MODULE_ALIAS("ipt_MARK");
MODULE_ALIAS("ip6t_MARK");
MODULE_ALIAS("arpt_MARK");
static unsigned int
mark_tg(struct sk_buff *skb, const struct xt_action_param *par)
{
const struct xt_mark_tginfo2 *info = par->targinfo;
skb->mark = (skb->mark & ~info->mask) ^ info->mark;
return XT_CONTINUE;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Jan Engelhardt | 50 | 100.00% | 2 | 100.00% |
Total | 50 | 100.00% | 2 | 100.00% |
static bool
mark_mt(const struct sk_buff *skb, struct xt_action_param *par)
{
const struct xt_mark_mtinfo1 *info = par->matchinfo;
return ((skb->mark & info->mask) == info->mark) ^ info->invert;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Linus Torvalds (pre-git) | 40 | 83.33% | 1 | 14.29% |
Jan Engelhardt | 7 | 14.58% | 5 | 71.43% |
Thomas Graf | 1 | 2.08% | 1 | 14.29% |
Total | 48 | 100.00% | 7 | 100.00% |
static struct xt_target mark_tg_reg __read_mostly = {
.name = "MARK",
.revision = 2,
.family = NFPROTO_UNSPEC,
.target = mark_tg,
.targetsize = sizeof(struct xt_mark_tginfo2),
.me = THIS_MODULE,
};
static struct xt_match mark_mt_reg __read_mostly = {
.name = "mark",
.revision = 1,
.family = NFPROTO_UNSPEC,
.match = mark_mt,
.matchsize = sizeof(struct xt_mark_mtinfo1),
.me = THIS_MODULE,
};
static int __init mark_mt_init(void)
{
int ret;
ret = xt_register_target(&mark_tg_reg);
if (ret < 0)
return ret;
ret = xt_register_match(&mark_mt_reg);
if (ret < 0) {
xt_unregister_target(&mark_tg_reg);
return ret;
}
return 0;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Jan Engelhardt | 45 | 78.95% | 3 | 50.00% |
Linus Torvalds (pre-git) | 10 | 17.54% | 1 | 16.67% |
Harald Welte | 1 | 1.75% | 1 | 16.67% |
Patrick McHardy | 1 | 1.75% | 1 | 16.67% |
Total | 57 | 100.00% | 6 | 100.00% |
static void __exit mark_mt_exit(void)
{
xt_unregister_match(&mark_mt_reg);
xt_unregister_target(&mark_tg_reg);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Jan Engelhardt | 10 | 47.62% | 3 | 50.00% |
Linus Torvalds (pre-git) | 8 | 38.10% | 1 | 16.67% |
Harald Welte | 2 | 9.52% | 1 | 16.67% |
Patrick McHardy | 1 | 4.76% | 1 | 16.67% |
Total | 21 | 100.00% | 6 | 100.00% |
module_init(mark_mt_init);
module_exit(mark_mt_exit);
Overall Contributors
Person | Tokens | Prop | Commits | CommitProp |
Jan Engelhardt | 196 | 60.68% | 8 | 47.06% |
Linus Torvalds (pre-git) | 80 | 24.77% | 1 | 5.88% |
Harald Welte | 32 | 9.91% | 2 | 11.76% |
Zhang Chunyu | 5 | 1.55% | 1 | 5.88% |
Patrick McHardy | 5 | 1.55% | 2 | 11.76% |
Pablo Neira Ayuso | 3 | 0.93% | 1 | 5.88% |
Thomas Graf | 1 | 0.31% | 1 | 5.88% |
Art Haas | 1 | 0.31% | 1 | 5.88% |
Total | 323 | 100.00% | 17 | 100.00% |
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.