diff options
Diffstat (limited to 'sys/netinet/sctp_constants.h')
-rw-r--r-- | sys/netinet/sctp_constants.h | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/sys/netinet/sctp_constants.h b/sys/netinet/sctp_constants.h index 212a2f9e05f0..e07afb466c98 100644 --- a/sys/netinet/sctp_constants.h +++ b/sys/netinet/sctp_constants.h @@ -322,7 +322,6 @@ __FBSDID("$FreeBSD$"); #define SCTP_VERSION_NUMBER 0x3 #define MAX_TSN 0xffffffff -#define MAX_SEQ 0xffff /* how many executions every N tick's */ #define SCTP_ITERATOR_MAX_AT_ONCE 20 @@ -906,10 +905,13 @@ __FBSDID("$FreeBSD$"); #define SCTP_MAX_DATA_BUNDLING 256 /* modular comparison */ -/* True if a > b (mod = M) */ -#define compare_with_wrap(a, b, M) (((a > b) && ((a - b) < ((M >> 1) + 1))) || \ - ((b > a) && ((b - a) > ((M >> 1) + 1)))) - +/* See RFC 1982 for details. */ +#define SCTP_SSN_GT(a, b) (((a < b) && ((b - a) > (1<<15))) || \ + ((a > b) && ((a - b) < (1<<15)))) +#define SCTP_SSN_GE(a, b) (SCTP_SSN_GT(a, b) || (a == b)) +#define SCTP_TSN_GT(a, b) (((a < b) && ((b - a) > (1<<31))) || \ + ((a > b) && ((a - b) < (1<<31)))) +#define SCTP_TSN_GE(a, b) (SCTP_TSN_GT(a, b) || (a == b)) /* Mapping array manipulation routines */ #define SCTP_IS_TSN_PRESENT(arry, gap) ((arry[(gap >> 3)] >> (gap & 0x07)) & 0x01) |