This is the mail archive of the ecos-discuss@sourceware.org mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: How to run testprograms for lwip


Sergei Gavrikov wrote:
Hi Simon,

Thank you for your contribution. I tried to built lwIP's with SNMP
support using your snapshot. Unfortunately, I ran in a problem with CPP
defines for eCos (lwipopts.h).

Glad there are people starting to test the port :)


mib2.c:70:
#define SNMP_SYSSERVICES ((1 << 6) | (1 << 3) | ((IP_FORWARD) << 2))

mib2.c:766:
static const s32_t sysservices = SNMP_SYSSERVICES;

lwipopts.h:102:
#define IP_FORWARD                  defined(CYGFUN_LWIP_IP_FORWARD)

So, the above init will become itself:

static const s32_t sysservices = ((1 << 6) | (1 << 3) | ((defined(CYGFUN_LWIP_IP_FORWARD)) << 2))

May be the below should be used in lwipopts.h?

#if defined(CYGFUN_LWIP_IP_FORWARD)
# define IP_FORWARD 1
#else
# define IP_FORWARD 0
#endif

That's exactly the right fix. There are already some other defines which use that scheme in lwipopts.h (CYGFUN_LWIP_PAP_SUPPORT is such an example).


FYI: There are a few defines like this

#define FOO defined(CYG_FOO)

in lwipopts.h. Small testcase:

#define CYG_FOO 1
#define FOO defined(CYG_FOO)

main ()
{
  int foo = FOO;
}

It cannot be linked. FOO is not boolean ;-) I can check the same
"rvalues" then and send a patch if you want.

As I have not used SNMP myself yet, it had to be expected that there are some issues left. If you can provide a patch that'd be great!


Simon

--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]