netdev
[Top] [All Lists]

Re: looking for help with scanning of IPv6 interfaces

To: Donald Becker <becker@xxxxxxxxx>
Subject: Re: looking for help with scanning of IPv6 interfaces
From: Andi Kleen <ak@xxxxxxx>
Date: Fri, 15 Nov 2002 23:52:00 +0100
Cc: Andi Kleen <ak@xxxxxxx>, Michael Richardson <mcr@xxxxxxxxxxxxxxxxxxxxxx>, netdev@xxxxxxxxxxx
In-reply-to: <Pine.LNX.4.44.0211151737010.6439-100000@beohost.scyld.com>
References: <20021115200051.A14677@wotan.suse.de> <Pine.LNX.4.44.0211151737010.6439-100000@beohost.scyld.com>
Sender: netdev-bounce@xxxxxxxxxxx
User-agent: Mutt/1.3.22.1i
> > Physical devices are read using /proc/net/dev
> ...
> > That is the old fashioned way.
> >  
> > The new fashioned one is to query them using rtnetlink. You use a 
> > RTM_GETADDR
> > NLM_F_REQUEST query with wildcard (NLM_F_ROOT) to get a full list.
> > See the netlink,rtnetlink, libnetlink manpages and iproute2 as an example. 
> > It is easier when you use libnetlink.
> 
> Do you have a snippet of code?

Check iproute2 or zebra source. iproute2 has a libnetlink which is quite useful.

I also wrote some manpages (netlink(3),netlink(7),rtnetlink(7) etc, but 
admittedly they are not very good) 

> What kernel version does this start working?

Somewhere in Linux 2.1.<late number> 
> 
> Of course for code that needs to work with already deployed systems, you
> need to have code for the old method around anyway...

Only when you still want to support 2.0. Ok some people do not enable
netlink in their kernel configuration, but many modern distributions
require it for booting now (because the network init scripts use iproute2),
so this shouldn't be a big issue anymore.

-Andi


<Prev in Thread] Current Thread [Next in Thread>