Skip to content

Commit

Permalink
[DCCP]: Introduce generic function to test for `data packets'
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Gerrit Renker authored and David S. Miller committed Jan 28, 2008
1 parent c40616c commit 2180c41
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions net/dccp/dccp.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down

0 comments on commit 2180c41

Please sign in to comment.