[ECOS] How to run lwip on 2 network interfaces?

Jani Monoses jani@iv.ro
Mon Jan 27 13:56:00 GMT 2003

the lwip_init() helper adds the default network interface
by doing something like

        IP_ADDR(&gw, 192,168,0,3);
        IP_ADDR(&netmask, CYGPKG_LWIP_NETMASK);
        IP_ADDR(&ipaddr, 192,168,0,4);
        temp = netif_add(&ipaddr, &netmask, &gw, slipif_init, tcpip_input);
however if you want to have multiple interfaces you'll need to call netif_add multiple times
look at how lwip_init in src/ecos/init.c does it.And since the .cdl only assumes one interface
you'll probably have to tweak that too for the second IP address or harcode it in the source.
For slip you have to enable the serial driver in ecos select the same comm parameters as the
host side (baudrate parity etc). and call netif_add like above passing slipif_init.
For ethernet you'll use ecosif_init instead.slipif init will use "/dev/ser0" by default 
you need to change that depending on the serial port you're using.
I have never used lwip with 2 interfaces so maybe you'll have some things to sort out.
Feel free to ask if anything unusual happens :)


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

More information about the Ecos-discuss mailing list