[ECOS] routing

Andrew Lunn andrew@lunn.ch
Wed Dec 15 21:59:00 GMT 2004


On Wed, Dec 15, 2004 at 12:16:33PM -0800, jared jared wrote:
> when i do this on my rh linux box:
> route add -net 192.168.5.0 netmask 255.255.255.0 eth3
> 
> i get a new entry in my routing table that does
> exactly what i want, direct all 192.168.5.X traffic to
> my eth3 NIC:
> 
> 192.168.5.0     *               255.255.255.0   U    
> 0      0        0 eth3
> 
> how can i get this same functionality on ecos?  my
> target has two stack interfaces(WAN and LAN) 
> 
> when i add my route with ioctl, i fill out the route
> structure:
> 
> dest - 192.168.2.0
> mask - 255.255.255.0
> gw - 0
> 
> and set flags for RTF_UPonly
> 
> i also set the devname in the route.rt_dev, but it
> seems as though this isn't ever used to determine
> which interface to add the route.  how am i supposed
> to specify the interface that i want to use for my
> route?
> 
> i took my code and compiled it on linux and i get the
> exact same funtionality as my "route add" example
> above, but on ecos i get a route on the incorrect
> interface.

The network stack in eCos is from FreeBSD. I suggest you look at the
sources for the route command from FreeBSD and test your code on a
FreeBSD machine. It probably does things a little different than
Linux.

You can see the source for the FreeBSD route command at
http://www.freebsd.org/cgi/cvsweb.cgi/src/sbin/route/route.c

        Andrew

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



More information about the Ecos-discuss mailing list