public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] How to run lwip on 2 network interfaces?
@ 2003-01-25  1:11 Bahadir Balban
  2003-01-27 13:56 ` Jani Monoses
  0 siblings, 1 reply; 2+ messages in thread
From: Bahadir Balban @ 2003-01-25  1:11 UTC (permalink / raw)
  To: ecos-discuss

Hi there,

I've got eCos ARM E7T template + LWIP + network drivers (IO_ETH_DRIVERS) + 
KS32C5000 ethernet driver compiled into libtarget.a

1st Question: How to register a network interface as the networkif for TCP/IP.

2nd: Question:
I would like to run LWIP both on the serial port with SLIP and on the ethernet 
interface. I know that LWIP can be SLIP enabled but perhaps this wouldn't be 
enough as the serial device is not registered as the network device in eCos.

On my linux host, I can easily add my /dev/ttyS0 serial device as a network 
interface and as well enable SLIP by typing:

% slattach -p slip -s 38400 /dev/ttyS0 &

% ifconfig sl0 192.68.1.221 pointopoint 192.68.1.222 netmask 255.255.255.0

and the routing table configured just as I wanted - sl0 and eth0 work together 
safely:

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.68.1.0      *               255.255.255.0   U     0      0        0 sl0
155.245.112.0   *               255.255.240.0   U     0      0        0 eth0
127.0.0.0       *               255.0.0.0       U     0      0        0 lo
default         safw0.essex.ac. 0.0.0.0         UG    0      0  

I don't know the way to achieve the same thing on my ARM target with eCos, 
Could you help me with this please? I have seen posts about 2 ethernet ports 
being enabled simultaneously. How is this achieved? Do I need to write a 
program with kernel calls?

Thank you very much,
Bahadir


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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [ECOS] How to run lwip on 2 network interfaces?
  2003-01-25  1:11 [ECOS] How to run lwip on 2 network interfaces? Bahadir Balban
@ 2003-01-27 13:56 ` Jani Monoses
  0 siblings, 0 replies; 2+ messages in thread
From: Jani Monoses @ 2003-01-27 13:56 UTC (permalink / raw)
  To: ecos-discuss

Hi
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 :)

Jani.


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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-01-27  7:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-01-25  1:11 [ECOS] How to run lwip on 2 network interfaces? Bahadir Balban
2003-01-27 13:56 ` Jani Monoses

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).