cregit-Linux how code gets into the kernel

Release 4.15 net/netfilter/xt_mark.c

Directory: net/netfilter
/*
 *      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

PersonTokensPropCommitsCommitProp
Jan Engelhardt50100.00%2100.00%
Total50100.00%2100.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

PersonTokensPropCommitsCommitProp
Linus Torvalds (pre-git)4083.33%114.29%
Jan Engelhardt714.58%571.43%
Thomas Graf12.08%114.29%
Total48100.00%7100.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

PersonTokensPropCommitsCommitProp
Jan Engelhardt4578.95%360.00%
Linus Torvalds (pre-git)1119.30%120.00%
Patrick McHardy11.75%120.00%
Total57100.00%5100.00%


static void __exit mark_mt_exit(void) { xt_unregister_match(&mark_mt_reg); xt_unregister_target(&mark_tg_reg); }

Contributors

PersonTokensPropCommitsCommitProp
Jan Engelhardt1047.62%350.00%
Linus Torvalds (pre-git)838.10%116.67%
Harald Welte29.52%116.67%
Patrick McHardy14.76%116.67%
Total21100.00%6100.00%

module_init(mark_mt_init); module_exit(mark_mt_exit);

Overall Contributors

PersonTokensPropCommitsCommitProp
Jan Engelhardt19660.68%847.06%
Linus Torvalds (pre-git)8125.08%15.88%
Harald Welte319.60%211.76%
Zhang Chunyu51.55%15.88%
Patrick McHardy51.55%211.76%
Pablo Neira Ayuso30.93%15.88%
Art Haas10.31%15.88%
Thomas Graf10.31%15.88%
Total323100.00%17100.00%
Directory: net/netfilter
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.
Created with cregit.