summaryrefslogtreecommitdiffstats
path: root/net/dccp/dccp.h
diff options
context:
space:
mode:
authorIan McDonald <ian.mcdonald@jandi.co.nz>2006-08-26 19:06:42 -0700
committerDavid S. Miller <davem@davemloft.net>2006-08-26 19:06:42 -0700
commit837d107cd101fbf734e9ea2bbb5c7336a329e432 (patch)
tree0a292efbba9272136365b62cf4d915a16ac0a130 /net/dccp/dccp.h
parente6bccd357343e98db9e1fd0d487f4f924e1a7921 (diff)
downloadlinux-837d107cd101fbf734e9ea2bbb5c7336a329e432.tar.bz2
[DCCP]: Introduces follows48 function
This adds a new function to see if two sequence numbers follow each other. Signed off by: Ian McDonald <ian.mcdonald@jandi.co.nz> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/dccp/dccp.h')
-rw-r--r--net/dccp/dccp.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/net/dccp/dccp.h b/net/dccp/dccp.h
index b8931d33bec3..a5c5475724c0 100644
--- a/net/dccp/dccp.h
+++ b/net/dccp/dccp.h
@@ -81,6 +81,14 @@ static inline u64 max48(const u64 seq1, const u64 seq2)
return after48(seq1, seq2) ? seq1 : seq2;
}
+/* is seq1 next seqno after seq2 */
+static inline int follows48(const u64 seq1, const u64 seq2)
+{
+ int diff = (seq1 & 0xFFFF) - (seq2 & 0xFFFF);
+
+ return diff==1;
+}
+
enum {
DCCP_MIB_NUM = 0,
DCCP_MIB_ACTIVEOPENS, /* ActiveOpens */