Project Home
Project Home
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - Adding/Deleting/Modifying routes: (5 Items)
   
Adding/Deleting/Modifying routes  
Hi,

I am trying to implement a simple API to add, delete and modify routes along with specifying outgoing interfaces (if 
possible, for cases where I have more than one interface with the same IP address).

I looked at the route utility and it seems to use raw sockets for programming routing table. Is that the recommended 
approach? In linux I think I was using Netlink/Dgram sockets to perform this function. Not sure what works with io-pkt.

Thanks,
Santosh 
RE: Adding/Deleting/Modifying routes  
Routing sockets (AF_ROUTE) are recommended whch is what the
'route' utility uses.

-seanb


-----Original Message-----
From: Santosh Kumar [mailto:community-noreply@qnx.com]
Sent: Thu 8/21/2008 7:59 PM
To: technology-networking
Subject: Adding/Deleting/Modifying routes
 
Hi,

I am trying to implement a simple API to add, delete and modify routes along with specifying outgoing interfaces (if 
possible, for cases where I have more than one interface with the same IP address).

I looked at the route utility and it seems to use raw sockets for programming routing table. Is that the recommended 
approach? In linux I think I was using Netlink/Dgram sockets to perform this function. Not sure what works with io-pkt.

Thanks,
Santosh 

_______________________________________________
Technology
http://community.qnx.com/sf/go/post12232


Attachment: Text winmail.dat 2.79 KB
Re: RE: Adding/Deleting/Modifying routes  
Hi Sean,

The route utility uses, RAW socket with AF_ROUTE/PF_ROUTE family and it seems to use rtmsg to perform the final setting.


Q: Do I have to use rtmsg and RAW socket for my implementation or can I use ioctl? Does only RAW socket work or DGRAM 
works as well?

Thanks,
Santosh
> Routing sockets (AF_ROUTE) are recommended whch is what the
> 'route' utility uses.
> 
> -seanb
> 
> 
> -----Original Message-----
> From: Santosh Kumar [mailto:community-noreply@qnx.com]
> Sent: Thu 8/21/2008 7:59 PM
> To: technology-networking
> Subject: Adding/Deleting/Modifying routes
>  
> Hi,
> 
> I am trying to implement a simple API to add, delete and modify routes along 
> with specifying outgoing interfaces (if possible, for cases where I have more 
> than one interface with the same IP address).
> 
> I looked at the route utility and it seems to use raw sockets for programming 
> routing table. Is that the recommended approach? In linux I think I was using 
> Netlink/Dgram sockets to perform this function. Not sure what works with io-
> pkt.
> 
> Thanks,
> Santosh 
> 
> _______________________________________________
> Technology
> http://community.qnx.com/sf/go/post12232
> 
> 


Re: RE: Adding/Deleting/Modifying routes  
On Fri, Aug 22, 2008 at 04:16:20PM -0400, Santosh Kumar wrote:
> Hi Sean,
> 
> The route utility uses, RAW socket with AF_ROUTE/PF_ROUTE family and it seems to use rtmsg to perform the final 
setting.
> 
> Q: Do I have to use rtmsg and RAW socket for my implementation or can I use ioctl? Does only RAW socket work or DGRAM 
works as well?

It has to be AF_ROUTE, SOCK_RAW.

-seanb
Re: Adding/Deleting/Modifying routes  
In Linux you can program with netlink and route socket both. Although netlink is a protocol too but I only LInux uses it
 as interface between userland and kernel.
In BSD only route socket available I think.