Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > Rollover Issue

Reply
Thread Tools

Rollover Issue

 
 
raj
Guest
Posts: n/a
 
      09-12-2003
Hi,

I am dealing with the sequence number rollover issue.
I need to compare the incoming packet sequence number w/ the one in the
table. There is good possibility that the incoming packet sequence number
has rolledover. I am using Unsigned data type to store the sequence number.
I read somewhere that I 've to do Signed arithmetic to deal with it.

I would appreciate if you can help me out. (Pseudo code would be helpful)

Thanks.
 
Reply With Quote
 
 
 
 
Nick Austin
Guest
Posts: n/a
 
      09-12-2003
On 12 Sep 2003 12:30:30 -0700, http://www.velocityreviews.com/forums/(E-Mail Removed) (raj) wrote:

>Hi,
>
>I am dealing with the sequence number rollover issue.
>I need to compare the incoming packet sequence number w/ the one in the
>table. There is good possibility that the incoming packet sequence number
>has rolledover. I am using Unsigned data type to store the sequence number.
>I read somewhere that I 've to do Signed arithmetic to deal with it.


You mean something like this:

#define N 64

unsigned long difference( unsigned long seq1, unsigned long seq2 )
{
return ( seq2 + N - seq1 ) % N;
}

Nick.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
CSS Button Rollover Effects Blake ASP .Net 3 05-18-2011 02:46 PM
Circular FIFO rollover issue Seebs C Programming 3 09-16-2009 12:31 AM
RollOver Control Paul King ASP .Net 0 08-17-2004 04:47 PM
Login "rollover" button question VB Programmer ASP .Net 0 06-09-2004 12:54 PM
Cisco Rollover Cable... Dave Cisco 4 11-29-2003 05:02 PM



Advertisments