* [PATCH 25/25]: Add test function for data packets
@ 2007-03-21 18:46 Gerrit Renker
2007-03-26 4:07 ` Ian McDonald
2007-04-02 8:59 ` Gerrit Renker
0 siblings, 2 replies; 3+ messages in thread
From: Gerrit Renker @ 2007-03-21 18:46 UTC (permalink / raw)
To: dccp
[DCCP]: Add test function for data packets
This adds a function which returns `true' when an skb contains one of the packet
types specified in [RFC 4340, 7.7] as `data packet'.
NB - Resisted the temptation to define
int dccp_non_data_packet(skb) { return !dccp_data_packet(skb); },
since maybe someone will define new packet types.
Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk>
---
net/dccp/dccp.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
--- a/net/dccp/dccp.h
+++ b/net/dccp/dccp.h
@@ -321,6 +321,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;
@@ -333,6 +334,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;
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 25/25]: Add test function for data packets
2007-03-21 18:46 [PATCH 25/25]: Add test function for data packets Gerrit Renker
@ 2007-03-26 4:07 ` Ian McDonald
2007-04-02 8:59 ` Gerrit Renker
1 sibling, 0 replies; 3+ messages in thread
From: Ian McDonald @ 2007-03-26 4:07 UTC (permalink / raw)
To: dccp
On 3/22/07, Gerrit Renker <gerrit@erg.abdn.ac.uk> wrote:
> [DCCP]: Add test function for data packets
>
Acked-by: Ian McDonald <ian.mcdonald@jandi.co.nz
I presume this is for following patches as no use yet. Normally
patches aren't merged into kernel until there is a use for them.
--
Web: http://wand.net.nz/~iam4
Blog: http://iansblog.jandi.co.nz
WAND Network Research Group
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 25/25]: Add test function for data packets
2007-03-21 18:46 [PATCH 25/25]: Add test function for data packets Gerrit Renker
2007-03-26 4:07 ` Ian McDonald
@ 2007-04-02 8:59 ` Gerrit Renker
1 sibling, 0 replies; 3+ messages in thread
From: Gerrit Renker @ 2007-04-02 8:59 UTC (permalink / raw)
To: dccp
| > [DCCP]: Add test function for data packets
| >
|
| I presume this is for following patches as no use yet. Normally
| patches aren't merged into kernel until there is a use for them.
Yes it is used - the CCID3 receiver tests repeatedly for data packets.
It may be useful in general too since it actually implements exactly
what RFC 4340 calls data packets.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2007-04-02 8:59 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-03-21 18:46 [PATCH 25/25]: Add test function for data packets Gerrit Renker
2007-03-26 4:07 ` Ian McDonald
2007-04-02 8:59 ` Gerrit Renker
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.