lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] TCP checksumming


From: address@hidden
Subject: Re: [lwip-users] TCP checksumming
Date: Mon, 25 Feb 2008 20:29:08 +0100
User-agent: Thunderbird 2.0.0.9 (Windows/20071031)

Bill Auerbach schrieb:
Bill Auerbach wrote:
One problem however: If I define LWIP_CHKSUM in my sys_arch.h,
inet_chksum.c doesn't know about it. I had to add #include
"sys_arch.h" to inet_chksum.c. In order to override LWIP_CHKSUM
without changing source code, shouldn't include sys_arch.h?

I don't think so: sys_arch.h is supposed to provide things needed for
the sys layer (like threads, mboxes and semaphores). When compiling with
NO_SYS=1, the whole stack should still be compilable without the whole
sys_arch.h file. You will have to put the definition somewhere else.
OK.  I see.  This define (LWIP_CHKSUM) belongs in lwipopts.h not sys_arch.h
as per the comment.  The question becomes where to put the prototype for the
replacement function.  If it's in sys_arch.h to match sys_arch.c where the
function definition is, then lwipopts.h or inet_chksum.c need sys_arch.h
added to get the prototype pulled in.
In my opinion, the comment is wrong. Also the place you want to put it seems wrong. The files sys_arch.c and sys_arch.h are supposed to be an architecture-dependent extension for sys.c. And sys.c's purpose is to provide OS abstraction functions. Like you already stated, the LWIP_CHKSUM function is needed regardless of the NO_SYS setting (in fact, that's what I meant in my last mail) so you have to put it somwhere else, not in sys_arch.c: sys.c and sys_arch.c don't have to be included in your build when compiling with NO_SYS=1!

You can just put the definition into cc.h or lwipopts.h and create your own c file with the function in it. And perhaps we should include an example in the contrib folder to clarify this for the future...?

Simon




reply via email to

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