lwip-devel
[Top][All Lists]
Advanced

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

Re: [lwip-devel] BSD/Linux compatibility


From: James G. Smith
Subject: Re: [lwip-devel] BSD/Linux compatibility
Date: Thu, 28 Jun 2012 16:34:58 +0100
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.24) Gecko/20111108 Fedora/3.1.16-1.fc14 Lightning/1.0b3pre Thunderbird/3.1.16

On 06/28/2012 03:55 PM, Kieran Mansley wrote:
> On Thu, 2012-06-28 at 10:14 +0100, James G. Smith wrote:
>> For example inet_ntop/pton (can easily be implemented as macro
>> wrappers
>> to *_ntoa_r/aton), definition of sa_family_t, manifests like
>> INET6_ADDRSTRLEN, provision of "struct sockaddr_storage", etc.
> 
> As long as including them doesn't bloat the code unnecessarily that's
> fine by me.  

There should not be any change in code/data size (unless some use is
made by the external-to-lwIP application code). The lwIP footprint
should not change.

It is primarily just name-mappings, or providing types that match what
BSD provides.

e.g. if someone wanted to use inet_ntop() then the following is a simple
mapping to the lwIP provided routines:

#define inet_ntop(__af,__src,__dst,__size) \
    (((__af) == AF_INET6) ? ip6addr_ntoa_r((__src),(__dst),(__size)) :
ipaddr_ntoa_r((__src),(__dst),(__size)))

So there would only be the hit of the conditional if "__af" is not a
constant, and again only if the developer wants to use the BSD
compatible (portable) name.

The aim is just to make it easier to work with BSD client programs
without each user of lwIP having to implement the same changes, or have
conditionals in their source for BSD-vs-lwIP builds.

-- Jamie



reply via email to

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