This is the mail archive of the ecos-discuss@sources.redhat.com 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]

Re: Help reqd for TCP/IP stack on ecos


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


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