From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7646 invoked by alias); 12 Oct 2007 12:26:01 -0000 Received: (qmail 7594 invoked by uid 22791); 12 Oct 2007 12:25:58 -0000 X-Spam-Check-By: sourceware.org Received: from londo.lunn.ch (HELO londo.lunn.ch) (80.238.139.98) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 12 Oct 2007 12:25:54 +0000 Received: from lunn by londo.lunn.ch with local (Exim 3.36 #1 (Debian)) id 1IgJaP-0007cM-00; Fri, 12 Oct 2007 14:25:49 +0200 Date: Fri, 12 Oct 2007 12:26:00 -0000 From: Andrew Lunn To: ?yvind Harboe Cc: eCos Discussion Message-ID: <20071012122549.GA27530@lunn.ch> Mail-Followup-To: ?yvind Harboe , eCos Discussion References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.16 (2007-06-11) X-IsSubscribed: yes Mailing-List: contact ecos-discuss-help@ecos.sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: ecos-discuss-owner@ecos.sourceware.org Subject: Re: [ECOS] Problems with application to use lwIP X-SW-Source: 2007-10/txt/msg00071.txt.bz2 On Fri, Oct 12, 2007 at 12:33:44PM +0200, ?yvind Harboe wrote: > I'm trying to use lwIP, but I run into problems because lwIP uses > macros, e.g. #define read(a,b,c), which screws things up. I've seen > some posts about people wishing for/thinking about making lwIP more > compatible with a "standard" eCos TCP/IP stack. > > Rather than try to adapt the code that is going to use lwIP(it > currently uses eCos FreeBSD + POSIX) or changing lwIP, I was wondering > if I could somehow pull off the following: > > - Use the standard include files from eCos instead of lwIP include > files so application continues to compile fine. > - Link w/lwIP only instead of trying to compile with it. > > This would require adding a .c file that implemented functions that > used the lwIP include files and exported function calls that were > compatible with lwIP. > > Any thoughts on this approach? I've had a quick look. Most of it is straight forward. There is a couple of problem though.... lwip has no recvmsg and sendmsg function. The missing sendmsg is the bigger problem because eCos maps all send functions to it. So your wrapper will need to implement it on top of what lwip provides. However i don't think this is a big problem. It looks like you can implement the functions needed for struct cyg_sock_ops. Implementing select looks a bit trickier. You are probably going to have to make the lwip implementation of select in /net/lwip_tcpip/current/src/api/socket.c conditional compiled so you can remove it. However i think the necessary calls backs are there to make an eCos style select work. Overall, i think it is feasible, but you won't really know until you try to implement it. Then the real details will become clear. Andrew -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss