11 #include <linux/module.h>
13 #include <linux/slab.h>
16 #include <linux/dccp.h>
18 #include <linux/netfilter/x_tables.h>
21 #include <linux/netfilter_ipv4/ip_tables.h>
22 #include <linux/netfilter_ipv6/ip6_tables.h>
30 #define DCCHECK(cond, option, flag, invflag) (!((flag) & (option)) \
31 || (!!((invflag) & (option)) ^ (cond)))
33 static unsigned char *dccp_optbuf;
44 const unsigned char *
op;
45 unsigned int optoff = __dccp_hdr_len(dh);
46 unsigned int optlen = dh->
dccph_doff*4 - __dccp_hdr_len(dh);
55 spin_lock_bh(&dccp_buflock);
56 op = skb_header_pointer(skb, protoff + optoff, optlen, dccp_optbuf);
62 for (i = 0; i < optlen; ) {
63 if (op[i] == option) {
64 spin_unlock_bh(&dccp_buflock);
74 spin_unlock_bh(&dccp_buflock);
78 spin_unlock_bh(&dccp_buflock);
88 return typemask & (1 << dh->dccph_type);
92 match_option(
u_int8_t option,
const struct sk_buff *skb,
unsigned int protoff,
93 const struct dccp_hdr *dh,
bool *hotdrop)
95 return dccp_find_option(option, skb, protoff, dh, hotdrop);
108 dh = skb_header_pointer(skb, par->
thoff,
sizeof(_dh), &_dh);
144 .checkentry = dccp_mt_check,
153 .checkentry = dccp_mt_check,
161 static int __init dccp_mt_init(
void)
181 static void __exit dccp_mt_exit(
void)