netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andi Kleen <ak@suse.de>
To: Donald Becker <becker@scyld.com>
Cc: Andi Kleen <ak@suse.de>,
	Michael Richardson <mcr@sandelman.ottawa.on.ca>,
	netdev@oss.sgi.com
Subject: Re: looking for help with scanning of IPv6 interfaces
Date: Fri, 15 Nov 2002 23:52:00 +0100	[thread overview]
Message-ID: <20021115235200.B8265@wotan.suse.de> (raw)
In-Reply-To: <Pine.LNX.4.44.0211151737010.6439-100000@beohost.scyld.com>

> > 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

  reply	other threads:[~2002-11-15 22:52 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-11-15 17:38 looking for help with scanning of IPv6 interfaces Michael Richardson
2002-11-15 19:00 ` Andi Kleen
2002-11-15 22:46   ` Donald Becker
2002-11-15 22:52     ` Andi Kleen [this message]
2002-11-19  2:31       ` jamal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20021115235200.B8265@wotan.suse.de \
    --to=ak@suse.de \
    --cc=becker@scyld.com \
    --cc=mcr@sandelman.ottawa.on.ca \
    --cc=netdev@oss.sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).