lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lwip-users] Re: [lwip] Re: lwIP on DSPs


From: Bill Knight
Subject: [lwip-users] Re: [lwip] Re: lwIP on DSPs
Date: Wed, 08 Jan 2003 22:29:44 -0000

The stuct definition you give below would work too.  However it
changes the names of the members of the structs and no longer hides
the details of the implementation.  The struct definition I gave
would work for 8 bit chars as well as 16 bit ones.  (It's just that
for 8 bit chars, the original is more efficient.)

However, as I referened in my last e-mail, a structure like

struct foo {
u8_t value1;
u16_t value2;
u8_t value3;
};

would cause problems.  Using the method you are proposing would
translate something like:

struct foo {
u16_t val1_val2hi;
u16_t val2lo_val3;
};

While this struct formation may not appear in any of the headers, I
would not like to learn that it did after converting the majority of
the code.

-Bill

On Monday 03 December 2001 21.17, you wrote:
I would expect the following to work: These are the first 32 bits of the IP 
header (taken from RFC791):

    0                   1                   2                   3   
    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |Version|  IHL  |Type of Service|          Total Length         |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

For a system with an 8 bit type, it would translate to

struct iphdr32bits8 {
  u8_t v_hl;
  u8_t tos;
  u16_t totlen;
}

For a system without an 8 bit type, I would use the 16 bit type instead and 
just define:

struct iphdr32bit16 {
  u16_t v_hl_tos;
  u16_t totlen;
}

Is it anything in this that would break with your DSP? (Or am I just missing 


[This message was sent through the lwip discussion list.]




reply via email to

[Prev in Thread] Current Thread [Next in Thread]