summaryrefslogtreecommitdiffstats
path: root/include/network.h
diff options
context:
space:
mode:
author/C=EU/ST=EU/CN=Pablo Neira Ayuso/emailAddress=pablo@netfilter.org </C=EU/ST=EU/CN=Pablo Neira Ayuso/emailAddress=pablo@netfilter.org>2007-06-04 15:19:42 +0000
committer/C=EU/ST=EU/CN=Pablo Neira Ayuso/emailAddress=pablo@netfilter.org </C=EU/ST=EU/CN=Pablo Neira Ayuso/emailAddress=pablo@netfilter.org>2007-06-04 15:19:42 +0000
commitcea33148e4ccf108f587e5796c026600aba35ab1 (patch)
treeff11c9044574357b1ae23fbcacc5155382aaa632 /include/network.h
parent3b08bd18d5f0364c8dfa6f2b974799919482d512 (diff)
o remove useless backlog parameter in multicast sockets
o remove reminiscents of delay destroy message and relax transitions o remove confusing StripNAT parameter: NAT support enabled by default o relax event tracking: *_update callbacks use cache_update_force o use wraparound-aware functions after/before/between o lots of cleanups
Diffstat (limited to 'include/network.h')
-rw-r--r--include/network.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/include/network.h b/include/network.h
index 176274e..5ba808a 100644
--- a/include/network.h
+++ b/include/network.h
@@ -30,4 +30,23 @@ enum {
NET_ACK = (1 << NET_ACK_BIT),
};
+/* extracted from net/tcp.h */
+
+/*
+ * The next routines deal with comparing 32 bit unsigned ints
+ * and worry about wraparound (automatic with unsigned arithmetic).
+ */
+
+static inline int before(__u32 seq1, __u32 seq2)
+{
+ return (__s32)(seq1-seq2) < 0;
+}
+#define after(seq2, seq1) before(seq1, seq2)
+
+/* is s2<=s1<=s3 ? */
+static inline int between(__u32 seq1, __u32 seq2, __u32 seq3)
+{
+ return seq3 - seq2 >= seq1 - seq2;
+}
+
#endif