[Top][All Lists]

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

RE: [lwip-devel] IPv6 design considerations

From: Bill Auerbach
Subject: RE: [lwip-devel] IPv6 design considerations
Date: Tue, 9 Nov 2010 08:07:26 -0500

>If that's enough that's fine. However, I would have thought we would
>need a new ip_addr_t-like struct that contains both the union and a type
>information (i.e. "isipv6"). For example, after creating a new tcp pcb,
>it would be nice to just pass in the address and connect to whatever the
>address points to. Otherwise, you would need different connect functions
>for v4 and v6 (as the address then has a different type).
>The downside is that the size of ipv4 addresses increases (which is
>quite optimal with 4 bytes, currently).

Maybe the 'isipv6' flag can be #if'ed out as well so the typedef for an IPv4 
build is as it is now.  You would need more possibly empty macros to test the 
flag and to reference the ip address.  The good part about keeping it 
typedef'ed to a struct is that the compiler will do the copy whether it's IPv4 
or IPv6 everywhere it's copied.  And most compilers are smart about seeing a 
4-byte struct copy and *not* using memcpy.


reply via email to

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