Commit 2180c41c authored by Gerrit Renker's avatar Gerrit Renker Committed by David S. Miller

[DCCP]: Introduce generic function to test for `data packets'

as per  RFC 4340, sec. 7.7.
Signed-off-by: default avatarGerrit Renker <gerrit@erg.abdn.ac.uk>
Signed-off-by: default avatarIan McDonald <ian.mcdonald@jandi.co.nz>
Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent c40616c5
...@@ -334,6 +334,7 @@ struct dccp_skb_cb { ...@@ -334,6 +334,7 @@ struct dccp_skb_cb {
#define DCCP_SKB_CB(__skb) ((struct dccp_skb_cb *)&((__skb)->cb[0])) #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) static inline int dccp_non_data_packet(const struct sk_buff *skb)
{ {
const __u8 type = DCCP_SKB_CB(skb)->dccpd_type; 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) ...@@ -346,6 +347,17 @@ static inline int dccp_non_data_packet(const struct sk_buff *skb)
type == DCCP_PKT_SYNCACK; 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) static inline int dccp_packet_without_ack(const struct sk_buff *skb)
{ {
const __u8 type = DCCP_SKB_CB(skb)->dccpd_type; const __u8 type = DCCP_SKB_CB(skb)->dccpd_type;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment