how to Add a route to a host in RTEMS ?

Thomas Doerfler Thomas.Doerfler at imd-systems.de
Fri Dec 6 13:12:00 UTC 2002


Hi,

I am not an expert in setting routing options, but maybe you 
might have a look into the "bootp_subr.c" file (in 
c/src/libnetworking/nfs or cpukit/libnetworking/nfs, depending 
on the rtems version you are working with). In this file, the 
routing table is modified in various ways, maybe you might use 
it as a starting point?

wkr,
	Thomas.


> Hai,
> I wanted to do some thing equivalent to the following
> commands :
> "ifconfig sl0 xxx.xxx.xxx.xxx pointopoint
> yyy.yyy.yyy.yyy up"
> 
> "route add default gw yyy.yyy.yyy.yyy"
> 
> I am configuring slo using the following structure:
> static struct rtems_bsdnet_ifconfig serial_config = 
> {
>   "sl0",                          /* name */
>   (int (*)(struct rtems_bsdnet_ifconfig *))slattach,
> /*attach function */
>   NULL,                           /* link to next
> interface */
>   "10.6.16.1",                    /* IP address */
>   "255.0.0.0",                    /* IP net mask */
> };
> 
> Actually i am trying to write a SLIP driver. Here i
> see that i cant specify the other end of the SLIP
> interface.
> 
> Can anyone help me out in this ...
> 
> Thanx in advance ..
> 
> Regards..
> Sudhir
> 
> --- Shailesh Hingole <shingole at cs.binghamton.edu>
> wrote:
> > 
> > You can use the function given below to add a
> > routing table entry after
> > you initialize the appropriate variables for
> > address,gateway and netmask.
> > 
> > rtems_bsdnet_rtrequest (RTM_ADD,
> >                                   (struct sockaddr
> > *)&address,
> >                                   (struct sockaddr
> > *)&gateway,
> >                                   (struct sockaddr
> > *)&netmask,
> >                                   (RTF_UP |
> > RTF_GATEWAY | RTF_STATIC),NULL)
> > 
> > You can call this function from the "Init" function
> > after you have
> > initialized the network.
> > 
> > -Shailesh
> > 
> > 
> > On Thu, 5 Dec 2002, sudhir pola wrote:
> > 
> > > Hai,
> > > I would like to know how to add a route to a host
> > in
> > > in RTEMS. I think it could be done using routing
> > > sockets but some how i am not able to do it may be
> > i
> > > am following the wrong procedure.
> > > Incase if anyone had earlier worked on this can
> > help
> > > me out on this.  
> > > It would be more helpful for me if any one can
> > provide
> > > me an example source code ..
> > > 
> > > Thanx in advance ..
> > > 
> > > regards,
> > > sudhir
> > > 
> > > __________________________________________________
> > > Do you Yahoo!?
> > > Yahoo! Mail Plus - Powerful. Affordable. Sign up
> > now.
> > > http://mailplus.yahoo.com
> > > 
> > 
> 
> 
> __________________________________________________
> Do you Yahoo!?
> Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
> http://mailplus.yahoo.com

--------------------------------------------
IMD Ingenieurbuero fuer Microcomputertechnik
Thomas Doerfler           Herbststrasse 8
D-82178 Puchheim          Germany
email:    Thomas.Doerfler at imd-systems.de
PGP public key available at: http://www.imd-
systems.de/pgp_key.htm




More information about the users mailing list