summaryrefslogtreecommitdiff
path: root/include/linux/dccp.h
diff options
context:
space:
mode:
authorHarald Welte <laforge@netfilter.org>2005-08-09 20:26:55 -0700
committerDavid S. Miller <davem@sunset.davemloft.net>2005-08-29 15:54:28 -0700
commit1d3de414eb20d937d82c5219fd13ee4cedc499cb (patch)
tree3e249fc3ecd33bdec336208a29f0a8fdea062439 /include/linux/dccp.h
parente2e268665f6c01686b477a6b0cc5a70bab689d54 (diff)
[NETFILTER]: New iptables DCCP protocol header match
Using this new iptables DCCP protocol header match, it is possible to create simplistic stateless packet filtering rules for DCCP. It permits matching of port numbers, packet type and options. Signed-off-by: Harald Welte <laforge@netfilter.org> Signed-off-by: Arnaldo Carvalho de Melo <acme@ghostprotocols.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/dccp.h')
-rw-r--r--include/linux/dccp.h16
1 files changed, 13 insertions, 3 deletions
diff --git a/include/linux/dccp.h b/include/linux/dccp.h
index fd1412ddb3ff..431d58923ba9 100644
--- a/include/linux/dccp.h
+++ b/include/linux/dccp.h
@@ -242,10 +242,15 @@ static inline struct dccp_hdr_ext *dccp_hdrx(const struct sk_buff *skb)
return (struct dccp_hdr_ext *)(skb->h.raw + sizeof(struct dccp_hdr));
}
+static inline unsigned int __dccp_basic_hdr_len(const struct dccp_hdr *dh)
+{
+ return sizeof(*dh) + (dh->dccph_x ? sizeof(struct dccp_hdr_ext) : 0);
+}
+
static inline unsigned int dccp_basic_hdr_len(const struct sk_buff *skb)
{
const struct dccp_hdr *dh = dccp_hdr(skb);
- return sizeof(*dh) + (dh->dccph_x ? sizeof(struct dccp_hdr_ext) : 0);
+ return __dccp_basic_hdr_len(dh);
}
static inline __u64 dccp_hdr_seq(const struct sk_buff *skb)
@@ -297,10 +302,15 @@ static inline struct dccp_hdr_reset *dccp_hdr_reset(struct sk_buff *skb)
return (struct dccp_hdr_reset *)(skb->h.raw + dccp_basic_hdr_len(skb));
}
+static inline unsigned int __dccp_hdr_len(const struct dccp_hdr *dh)
+{
+ return __dccp_basic_hdr_len(dh) +
+ dccp_packet_hdr_len(dh->dccph_type);
+}
+
static inline unsigned int dccp_hdr_len(const struct sk_buff *skb)
{
- return dccp_basic_hdr_len(skb) +
- dccp_packet_hdr_len(dccp_hdr(skb)->dccph_type);
+ return __dccp_hdr_len(dccp_hdr(skb));
}