Rollover Issue

Discussion in 'C Programming' started by raj, Sep 12, 2003.

  1. raj

    raj Guest

    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.
    raj, Sep 12, 2003
    #1
    1. Advertising

  2. raj

    Nick Austin Guest

    On 12 Sep 2003 12:30:30 -0700, (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.
    Nick Austin, Sep 12, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. VB Programmer

    Login "rollover" button question

    VB Programmer, Jun 9, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    410
    VB Programmer
    Jun 9, 2004
  2. Blake

    CSS Button Rollover Effects

    Blake, Jun 30, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    4,092
    jazz831
    May 18, 2011
  3. Paul King

    RollOver Control

    Paul King, Aug 17, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    385
    Paul King
    Aug 17, 2004
  4. Brian Henry

    mouse rollover row on datagrid

    Brian Henry, Oct 16, 2004, in forum: ASP .Net
    Replies:
    4
    Views:
    2,060
    Steven Cheng[MSFT]
    Oct 18, 2004
  5. Seebs

    Circular FIFO rollover issue

    Seebs, Sep 15, 2009, in forum: C Programming
    Replies:
    3
    Views:
    864
    Rajeev
    Sep 16, 2009
Loading...

Share This Page