: New RX History Step 4 - Data Packet Utility Function (part 2 RX RTT sampling)
PATCH 6/9 : New RX History Step 4 - Data Packet Utility Function (part 2 RX RTT sampling)
[DCCP]: New RX History Step 4 - Data Packet Utility Function (part 2 RX RTT sampling)
For a clean integration of receiver-based RTT sampling, the next patch needs a test function which says whether a received packet is a data packet according to [RFC 4340, 7.7].
Such a function is provided by this patch, and it is integrated into the main DCCP code, since it is generic and usable by other parts of the DCCP/CCID code.
Signed-off-by Gerrit Renker <[email protected]>
--- net/dccp/dccp.h | 12 ++++++++++++ 1 file changed, 12 insertions(+)
net/dccp/dccp.h +12 -0
@@ -322,6 +322,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;
@@ -334,6 +335,17 @@ static inline int dccp_non_data_packet(c 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;
Quoted 2 lines · Gerrit Renker
[DCCP]: New RX History Step 4 - Data Packet Utility Function (part 2 RX RTT sampling)
Signed-off-by Gerrit Renker <[email protected]>
Signed-off-by Ian McDonald <[email protected]>
Signature · 3 lines
Web: http://wand.net.nz/~iam4/ Blog: http://iansblog.jandi.co.nz WAND Network Research Group