diff options
author | Gerrit Renker <gerrit@erg.abdn.ac.uk> | 2007-12-06 15:27:15 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-28 23:56:40 +0100 |
commit | 2180c41ca5c1a36c67f4140e80154699333109d2 (patch) | |
tree | 77438292f56f848fea4cb44f097234a1f3c9acf7 /net/dccp/dccp.h | |
parent | [TFRC]: Provide central source file and debug facility (diff) | |
download | linux-2180c41ca5c1a36c67f4140e80154699333109d2.tar.xz linux-2180c41ca5c1a36c67f4140e80154699333109d2.zip |
[DCCP]: Introduce generic function to test for `data packets'
as per RFC 4340, sec. 7.7.
Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk>
Signed-off-by: Ian McDonald <ian.mcdonald@jandi.co.nz>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to '')
-rw-r--r-- | net/dccp/dccp.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/net/dccp/dccp.h b/net/dccp/dccp.h index ee97950d77d1..f4a5ea116e34 100644 --- a/net/dccp/dccp.h +++ b/net/dccp/dccp.h @@ -334,6 +334,7 @@ struct dccp_skb_cb { #define DCCP_SKB_CB(__skb) ((struct dccp_skb_cb *)&((__skb)->cb[0])) +/* RFC 4340, sec. 7.7 */ static inline int dccp_non_data_packet(const struct sk_buff *skb) { const __u8 type = DCCP_SKB_CB(skb)->dccpd_type; @@ -346,6 +347,17 @@ static inline int dccp_non_data_packet(const struct sk_buff *skb) type == DCCP_PKT_SYNCACK; } +/* RFC 4340, sec. 7.7 */ +static inline int dccp_data_packet(const struct sk_buff *skb) +{ + const __u8 type = DCCP_SKB_CB(skb)->dccpd_type; + + return type == DCCP_PKT_DATA || + type == DCCP_PKT_DATAACK || + type == DCCP_PKT_REQUEST || + type == DCCP_PKT_RESPONSE; +} + static inline int dccp_packet_without_ack(const struct sk_buff *skb) { const __u8 type = DCCP_SKB_CB(skb)->dccpd_type; |