From owner-freebsd-hackers@FreeBSD.ORG Sat Jan 24 19:37:51 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4496816A4CE for ; Sat, 24 Jan 2004 19:37:51 -0800 (PST) Received: from dragon.rutgers.edu (dragon.rutgers.edu [128.6.25.118]) by mx1.FreeBSD.org (Postfix) with ESMTP id F350E43D39 for ; Sat, 24 Jan 2004 19:37:49 -0800 (PST) (envelope-from bohra@cs.rutgers.edu) Received: by dragon.rutgers.edu (CommuniGate Pro PIPE 4.1) with PIPE id 11236749; Sat, 24 Jan 2004 22:37:49 -0500 X-Spam-Status-LCSR: dragon spam scanned Received: from [128.6.171.146] (account bohra HELO cs.rutgers.edu) by dragon.rutgers.edu (CommuniGate Pro SMTP 4.1) with ESMTP id 11236743 for freebsd-hackers@freebsd.org; Sat, 24 Jan 2004 22:37:32 -0500 Message-ID: <401339A8.7020104@cs.rutgers.edu> Date: Sat, 24 Jan 2004 22:36:08 -0500 From: Aniruddha Bohra User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.5) Gecko/20031024 X-Accept-Language: en-us, en MIME-Version: 1.0 To: freebsd-hackers@freebsd.org Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Checker-Version: SpamAssassin 2.61 (1.212.2.1-2003-12-09-exp) on spamfilter.rutgers.edu X-Spam-Level: X-Spam-Status: No, hits=-4.9 required=5.0 tests=BAYES_00 autolearn=ham version=2.61 Subject: RFC 1892 - serial arithmetic X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Jan 2004 03:37:51 -0000 Hello, I was wondering if there is a standard header file that implements the RFC 1982 ? It basically defines serial numbers and the arithmetic operations on them. All it does is : s' = (s + n) modulo (2 ^ SERIAL_BITS) i1 is the arithmetic integer whose value is the same as s1, and i2 has the same value as i2 s1 is said to be less than s2 if, and only if, s1 is not equal to s2, and (i1 < i2 and i2 - i1 < 2^(SERIAL_BITS - 1)) or (i1 > i2 and i1 - i2 > 2^(SERIAL_BITS - 1)) s1 is said to be greater than s2 if, and only if, s1 is not equal to s2, and (i1 < i2 and i2 - i1 > 2^(SERIAL_BITS - 1)) or (i1 > i2 and i1 - i2 < 2^(SERIAL_BITS - 1)) I am currently using these as my local defns but would like to use a standard header if possible. Thanks Aniruddha