/* (C) 1999-2001 Michal Ludvig <michal@logix.cz> * * 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/if_ether.h> #include <linux/if_packet.h> #include <linux/in.h> #include <linux/ip.h> #include <linux/ipv6.h> #include <linux/netfilter/xt_pkttype.h> #include <linux/netfilter/x_tables.h> MODULE_LICENSE("GPL"); MODULE_AUTHOR("Michal Ludvig <michal@logix.cz>"); MODULE_DESCRIPTION("Xtables: link layer packet type match"); MODULE_ALIAS("ipt_pkttype"); MODULE_ALIAS("ip6t_pkttype");
static bool pkttype_mt(const struct sk_buff *skb, struct xt_action_param *par) { const struct xt_pkttype_info *info = par->matchinfo; u_int8_t type; if (skb->pkt_type != PACKET_LOOPBACK) type = skb->pkt_type; else if (xt_family(par) == NFPROTO_IPV4 && ipv4_is_multicast(ip_hdr(skb)->daddr)) type = PACKET_MULTICAST; else if (xt_family(par) == NFPROTO_IPV6) type = PACKET_MULTICAST; else type = PACKET_BROADCAST; return (type == info->pkttype) ^ info->invert; }Contributors
Person | Tokens | Prop | Commits | CommitProp |
Jan Engelhardt | 36 | 36.00% | 7 | 53.85% |
Harald Welte | 31 | 31.00% | 2 | 15.38% |
Phil Oester | 23 | 23.00% | 1 | 7.69% |
Pablo Neira Ayuso | 6 | 6.00% | 1 | 7.69% |
Arnaldo Carvalho de Melo | 3 | 3.00% | 1 | 7.69% |
Joe Perches | 1 | 1.00% | 1 | 7.69% |
Total | 100 | 100.00% | 13 | 100.00% |
Person | Tokens | Prop | Commits | CommitProp |
Harald Welte | 11 | 68.75% | 2 | 40.00% |
Jan Engelhardt | 4 | 25.00% | 2 | 40.00% |
Patrick McHardy | 1 | 6.25% | 1 | 20.00% |
Total | 16 | 100.00% | 5 | 100.00% |
Person | Tokens | Prop | Commits | CommitProp |
Harald Welte | 11 | 73.33% | 2 | 50.00% |
Jan Engelhardt | 4 | 26.67% | 2 | 50.00% |
Total | 15 | 100.00% | 4 | 100.00% |
Person | Tokens | Prop | Commits | CommitProp |
Harald Welte | 126 | 53.39% | 3 | 15.00% |
Jan Engelhardt | 55 | 23.31% | 9 | 45.00% |
Phil Oester | 29 | 12.29% | 1 | 5.00% |
Patrick McHardy | 12 | 5.08% | 3 | 15.00% |
Pablo Neira Ayuso | 6 | 2.54% | 1 | 5.00% |
Art Haas | 4 | 1.69% | 1 | 5.00% |
Arnaldo Carvalho de Melo | 3 | 1.27% | 1 | 5.00% |
Joe Perches | 1 | 0.42% | 1 | 5.00% |
Total | 236 | 100.00% | 20 | 100.00% |