Release 4.7 net/netfilter/xt_LOG.c
/*
* This is a module which is used for logging packets.
*/
/* (C) 1999-2001 Paul `Rusty' Russell
* (C) 2002-2004 Netfilter Core Team <coreteam@netfilter.org>
*
* 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.
*/
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/module.h>
#include <linux/spinlock.h>
#include <linux/skbuff.h>
#include <linux/if_arp.h>
#include <linux/ip.h>
#include <net/ipv6.h>
#include <net/icmp.h>
#include <net/udp.h>
#include <net/tcp.h>
#include <net/route.h>
#include <linux/netfilter.h>
#include <linux/netfilter/x_tables.h>
#include <linux/netfilter/xt_LOG.h>
#include <linux/netfilter_ipv6/ip6_tables.h>
#include <net/netfilter/nf_log.h>
static unsigned int
log_tg(struct sk_buff *skb, const struct xt_action_param *par)
{
const struct xt_log_info *loginfo = par->targinfo;
struct nf_loginfo li;
struct net *net = par->net;
li.type = NF_LOG_TYPE_LOG;
li.u.log.level = loginfo->level;
li.u.log.logflags = loginfo->logflags;
nf_log_packet(net, par->family, par->hooknum, skb, par->in, par->out,
&li, "%s", loginfo->prefix);
return XT_CONTINUE;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
harald welte | harald welte | 57 | 53.77% | 2 | 15.38% |
richard weinberger | richard weinberger | 27 | 25.47% | 1 | 7.69% |
hans schillstrom | hans schillstrom | 10 | 9.43% | 1 | 7.69% |
jan engelhardt | jan engelhardt | 6 | 5.66% | 4 | 30.77% |
pablo neira ayuso | pablo neira ayuso | 3 | 2.83% | 2 | 15.38% |
patrick mchardy | patrick mchardy | 1 | 0.94% | 1 | 7.69% |
eric w. biederman | eric w. biederman | 1 | 0.94% | 1 | 7.69% |
herbert xu | herbert xu | 1 | 0.94% | 1 | 7.69% |
| Total | 106 | 100.00% | 13 | 100.00% |
static int log_tg_check(const struct xt_tgchk_param *par)
{
const struct xt_log_info *loginfo = par->targinfo;
if (par->family != NFPROTO_IPV4 && par->family != NFPROTO_IPV6)
return -EINVAL;
if (loginfo->level >= 8) {
pr_debug("level %u >= 8\n", loginfo->level);
return -EINVAL;
}
if (loginfo->prefix[sizeof(loginfo->prefix)-1] != '\0') {
pr_debug("prefix is not null-terminated\n");
return -EINVAL;
}
return nf_logger_find_get(par->family, NF_LOG_TYPE_LOG);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
pre-git | pre-git | 59 | 57.84% | 1 | 10.00% |
richard weinberger | richard weinberger | 19 | 18.63% | 1 | 10.00% |
jan engelhardt | jan engelhardt | 12 | 11.76% | 5 | 50.00% |
pablo neira ayuso | pablo neira ayuso | 8 | 7.84% | 1 | 10.00% |
patrick mchardy | patrick mchardy | 4 | 3.92% | 2 | 20.00% |
| Total | 102 | 100.00% | 10 | 100.00% |
static void log_tg_destroy(const struct xt_tgdtor_param *par)
{
nf_logger_put(par->family, NF_LOG_TYPE_LOG);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
pablo neira ayuso | pablo neira ayuso | 21 | 100.00% | 1 | 100.00% |
| Total | 21 | 100.00% | 1 | 100.00% |
static struct xt_target log_tg_regs[] __read_mostly = {
{
.name = "LOG",
.family = NFPROTO_IPV4,
.target = log_tg,
.targetsize = sizeof(struct xt_log_info),
.checkentry = log_tg_check,
.destroy = log_tg_destroy,
.me = THIS_MODULE,
},
#if IS_ENABLED(CONFIG_IP6_NF_IPTABLES)
{
.name = "LOG",
.family = NFPROTO_IPV6,
.target = log_tg,
.targetsize = sizeof(struct xt_log_info),
.checkentry = log_tg_check,
.destroy = log_tg_destroy,
.me = THIS_MODULE,
},
#endif
};
static int __init log_tg_init(void)
{
return xt_register_targets(log_tg_regs, ARRAY_SIZE(log_tg_regs));
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
pre-git | pre-git | 10 | 50.00% | 1 | 20.00% |
richard weinberger | richard weinberger | 7 | 35.00% | 1 | 20.00% |
pablo neira ayuso | pablo neira ayuso | 1 | 5.00% | 1 | 20.00% |
jan engelhardt | jan engelhardt | 1 | 5.00% | 1 | 20.00% |
gao feng | gao feng | 1 | 5.00% | 1 | 20.00% |
| Total | 20 | 100.00% | 5 | 100.00% |
static void __exit log_tg_exit(void)
{
xt_unregister_targets(log_tg_regs, ARRAY_SIZE(log_tg_regs));
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
pre-git | pre-git | 10 | 52.63% | 1 | 33.33% |
richard weinberger | richard weinberger | 8 | 42.11% | 1 | 33.33% |
jan engelhardt | jan engelhardt | 1 | 5.26% | 1 | 33.33% |
| Total | 19 | 100.00% | 3 | 100.00% |
module_init(log_tg_init);
module_exit(log_tg_exit);
MODULE_LICENSE("GPL");
MODULE_AUTHOR("Netfilter Core Team <coreteam@netfilter.org>");
MODULE_AUTHOR("Jan Rekorajski <baggins@pld.org.pl>");
MODULE_DESCRIPTION("Xtables: IPv4/IPv6 packet logging");
MODULE_ALIAS("ipt_LOG");
MODULE_ALIAS("ip6t_LOG");
Overall Contributors
| Person | Tokens | Prop | Commits | CommitProp |
richard weinberger | richard weinberger | 148 | 32.03% | 1 | 3.23% |
pre-git | pre-git | 122 | 26.41% | 1 | 3.23% |
harald welte | harald welte | 61 | 13.20% | 3 | 9.68% |
pablo neira ayuso | pablo neira ayuso | 44 | 9.52% | 4 | 12.90% |
jan engelhardt | jan engelhardt | 38 | 8.23% | 9 | 29.03% |
patrick mchardy | patrick mchardy | 24 | 5.19% | 8 | 25.81% |
art haas | art haas | 12 | 2.60% | 1 | 3.23% |
hans schillstrom | hans schillstrom | 10 | 2.16% | 1 | 3.23% |
herbert xu | herbert xu | 1 | 0.22% | 1 | 3.23% |
eric w. biederman | eric w. biederman | 1 | 0.22% | 1 | 3.23% |
gao feng | gao feng | 1 | 0.22% | 1 | 3.23% |
| Total | 462 | 100.00% | 31 | 100.00% |
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.