1*8409Swnj /* nsp_seq.h 1.3 82/10/09 */ 26828Ssam 36828Ssam /* 46828Ssam * NSP sequence numbers are 12 bit integers operated 56828Ssam * on with modular arithmetic. These macros can be 66828Ssam * used to compare and perform arithmetic on such integers. 76828Ssam */ 86828Ssam #define MAXSEQ (1<<12) 96828Ssam #define SEQMASK (MAXSEQ-1) 106828Ssam 116828Ssam #define SEQ_LSS(a, b) (nsp_seqcmp(a, b) < 0) 126828Ssam #define SEQ_LEQ(a, b) (nsp_seqcmp(a, b) <= 0) 136828Ssam #define SEQ_GTR(a, b) (nsp_seqcmp(a, b) > 0) 146828Ssam #define SEQ_GEQ(a, b) (nsp_seqcmp(a, b) >= 0) 156828Ssam 166828Ssam #define SEQ_ADD(a, b) (((a) + (b)) & SEQMASK) 176828Ssam #define SEQ_SUB(a, b) (((a) - (b)) & SEQMASK) 18