[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [lwip-users] TCPH_OFFSET
From: |
Kieran Mansley |
Subject: |
Re: [lwip-users] TCPH_OFFSET |
Date: |
Wed, 5 Mar 2003 13:46:39 +0000 (GMT) |
On Wed, 5 Mar 2003, Zschocke, Florian wrote:
> tcp.h:
>
> #define TCPH_OFFSET(hdr) (NTOHS((hdr)->_offset_flags) >> 8)
>
> What would be the specific reason that TCPH_OFFSET was defined like this and
> that it gets only used as (TCPH_OFFSET >> 4) all over the lwIP code? Is
> there a special reason why not simply a TCPH_HDRLEN(hdr) was defined as
> follows?
>
> #define TCPH_HDRLEN(hdr) (NTOHS((hdr)->_offset_flags) >> 12)
I think that would work fine. I guess it was designed to provide access
to both the offset and the other bits (I think they're reserved, not sure
what if anything they're used for) but I agree that your suggestion would
improve the readability of the code.
Kieran