how to Add a route to a host in RTEMS ?

sudhir pola surya_hi at yahoo.com
Fri Dec 6 12:01:57 UTC 2002


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



More information about the users mailing list