1*c98c74b7Swnj /* nsp_seq.h 1.3 82/10/09 */ 266c2d381Ssam 366c2d381Ssam /* 466c2d381Ssam * NSP sequence numbers are 12 bit integers operated 566c2d381Ssam * on with modular arithmetic. These macros can be 666c2d381Ssam * used to compare and perform arithmetic on such integers. 766c2d381Ssam */ 866c2d381Ssam #define MAXSEQ (1<<12) 966c2d381Ssam #define SEQMASK (MAXSEQ-1) 1066c2d381Ssam 1166c2d381Ssam #define SEQ_LSS(a, b) (nsp_seqcmp(a, b) < 0) 1266c2d381Ssam #define SEQ_LEQ(a, b) (nsp_seqcmp(a, b) <= 0) 1366c2d381Ssam #define SEQ_GTR(a, b) (nsp_seqcmp(a, b) > 0) 1466c2d381Ssam #define SEQ_GEQ(a, b) (nsp_seqcmp(a, b) >= 0) 1566c2d381Ssam 1666c2d381Ssam #define SEQ_ADD(a, b) (((a) + (b)) & SEQMASK) 1766c2d381Ssam #define SEQ_SUB(a, b) (((a) - (b)) & SEQMASK) 18