This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: Help reqd for TCP/IP stack on ecos
- To: sujith k <sujith at c4 dot com>
- Subject: [ECOS] Re: Help reqd for TCP/IP stack on ecos
- From: Andrew Lunn <andrew dot lunn at ascom dot ch>
- Date: Thu, 1 Nov 2001 09:32:21 +0100
- Cc: ecos-discuss at sourceware dot cygnus dot com
- References: <20011101060133.15224.qmail@purina.chek.com>
On Thu, Nov 01, 2001 at 06:01:33AM -0000, sujith k wrote:
> I am not sure, the initialization what I am doing is correct...(24
> bridge ports and one IP interface)
First make sure you actually compile the bridge code. You need to set
the CDL component CYGPKG_NET_BRIDGE.
Then bring up one interface using init_net() so that an IP address is
assigned.
Then look at the example code in
/packages/net/tcpip/current/tests/bridge.c. You want to do something like.
char interfacename[6];
int i;
for (i=0;i<24;i++) {
sprintf(interfacename,"eth%d",i);
interface_up(interfacename);
bridge_add(sock,brdg,interfacename);
}
bridge_status(sock,brdg);
bridge_setflag(sock,brdg, IFF_UP);
but check the return codes for errors!
That will bring each device up and add it to the bridge.
Andrew