Re: Routing Table Entries in user mode

From: Barry Margolin (barmar_at_alum.mit.edu)
Date: 04/30/04


Date: Fri, 30 Apr 2004 00:32:05 -0400

In article <d1a53e30.0404291950.41230ab3@posting.google.com>,
 krishnavora@indiatimes.com (Krishna) wrote:

> Barry Margolin <barmar@alum.mit.edu> wrote in message
> news:<barmar-BEABD3.11564529042004@comcast.ash.giganews.com>...
> > In article <d1a53e30.0404290310.7b8336df@posting.google.com>,
> > krishnavora@indiatimes.com (Krishna) wrote:
> >
> > > Is there any ioctls available to get the entries. I have already got
> > > the subnet Mask & metrics but I need to get the next hop.
> >
> > See the chapter on Routing Sockets in Unix Network Programming, Vol.1.
>
> Thanks!
>
> But it requires superuser perms which my program will not be able to
> get.

No, reading the routing table doesn't require privileges, according to
UNP.

> Ans sysctl() is not supported.
>
> My main requirement is to get a normal user process without any su
> privileges to get the routing table entries.

If your OS doesn't provide sysctl(), I don't think it can be done.
Before routing sockets were invented, the only way to get the routing
table was by reading kernel memory directly, and that *does* require
privilege.

-- 
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***


Relevant Pages

  • Re: multiple internet gateways
    ... reading about policy based routing, ... You would have to figure out how to do source-based routing. ... What you -can- do on the ASA would be to NAT the different groups ...
    (comp.dcom.sys.cisco)
  • Re: How-to Print w/inter-vlan routing?
    ... solution for sharing a printer and saving costs. ... I keep reading on ip ... routing and it seems like it makes sense but without the practice and ...
    (microsoft.public.win2000.networking)
  • Re: Questions about running multiple Routers in my home
    ... Networking, Internet, Routing, VPN Troubleshooting on http://www.ChicagoTech.net ... Second by reading this doc fron netgear KB: ...
    (microsoft.public.windowsxp.network_web)
  • Re: LookupPrivilegeValue() failing with error code 1722
    ... Thanks for the link - interesting reading. ... this is a privileges issue though. ... not quite as easy to implement the sort of wrapper class described in the ... The following webLink should shed more light on the subject: ...
    (microsoft.public.platformsdk.security)
  • Re: Routing Table Entries in user mode
    ... On some systems, such as Solaris prior to S10, it does. ... >> privileges to get the routing table entries. ... There are ways other than sysctl. ...
    (comp.unix.solaris)