From: Andi Kleen <ak@suse.de>
To: Michael Richardson <mcr@sandelman.ottawa.on.ca>
Cc: netdev@oss.sgi.com
Subject: Re: looking for help with scanning of IPv6 interfaces
Date: Fri, 15 Nov 2002 20:00:51 +0100 [thread overview]
Message-ID: <20021115200051.A14677@wotan.suse.de> (raw)
In-Reply-To: <200211151738.gAFHcDwX006227@sandelman.ottawa.on.ca>
On Fri, Nov 15, 2002 at 12:38:12PM -0500, Michael Richardson wrote:
> 1) Awhile ago there was a flame war about using SIOCGIFCONF/SIOCGLIFCONF
> to get lists of interfaces. This was suggested as being a bad way.
>
> 2) bind 9.3snapshot is able to get a list of IPv4 addresses with SIOCGIFCONF,
>
> 3) it is not able to get IPv6 addresses with SIOCGLIFCONF.
>
> Marc Andrews, sitting next to me, asked if I knew what the offical magic
> was. Can someone point me that officially blessed way to do this?
Physical devices are read using /proc/net/dev
If you want IPv6 addresses you can read and parse /proc/net/if_inet6
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.
-Andi
next prev parent reply other threads:[~2002-11-15 19:00 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 [this message]
2002-11-15 22:46 ` Donald Becker
2002-11-15 22:52 ` Andi Kleen
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=20021115200051.A14677@wotan.suse.de \
--to=ak@suse.de \
--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).