/* (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 (par->family == NFPROTO_IPV4 && ipv4_is_multicast(ip_hdr(skb)->daddr)) type = PACKET_MULTICAST; else if (par->family == NFPROTO_IPV6 && ipv6_hdr(skb)->daddr.s6_addr[0] == 0xFF) type = PACKET_MULTICAST; else type = PACKET_BROADCAST; return (type == info->pkttype) ^ info->invert; }Contributors
Person | Tokens | Prop | Commits | CommitProp | |
jan engelhardt | jan engelhardt | 54 | 48.21% | 7 | 58.33% |
harald welte | harald welte | 31 | 27.68% | 2 | 16.67% |
phil oester | phil oester | 23 | 20.54% | 1 | 8.33% |
arnaldo carvalho de melo | arnaldo carvalho de melo | 3 | 2.68% | 1 | 8.33% |
joe perches | joe perches | 1 | 0.89% | 1 | 8.33% |
Total | 112 | 100.00% | 12 | 100.00% |
Person | Tokens | Prop | Commits | CommitProp | |
harald welte | harald welte | 11 | 68.75% | 2 | 40.00% |
jan engelhardt | jan engelhardt | 4 | 25.00% | 2 | 40.00% |
patrick mchardy | patrick mchardy | 1 | 6.25% | 1 | 20.00% |
Total | 16 | 100.00% | 5 | 100.00% |
Person | Tokens | Prop | Commits | CommitProp | |
harald welte | harald welte | 11 | 73.33% | 2 | 50.00% |
jan engelhardt | jan engelhardt | 4 | 26.67% | 2 | 50.00% |
Total | 15 | 100.00% | 4 | 100.00% |
Person | Tokens | Prop | Commits | CommitProp | |
harald welte | harald welte | 126 | 50.81% | 3 | 15.79% |
jan engelhardt | jan engelhardt | 73 | 29.44% | 9 | 47.37% |
phil oester | phil oester | 29 | 11.69% | 1 | 5.26% |
patrick mchardy | patrick mchardy | 12 | 4.84% | 3 | 15.79% |
art haas | art haas | 4 | 1.61% | 1 | 5.26% |
arnaldo carvalho de melo | arnaldo carvalho de melo | 3 | 1.21% | 1 | 5.26% |
joe perches | joe perches | 1 | 0.40% | 1 | 5.26% |
Total | 248 | 100.00% | 19 | 100.00% |