-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

,--[ On Sun, Jun 08, 2008 at 10:35:52PM +0530, Debarshi Ray wrote:
| I am looking for a portable way to read the IPv6 address of a network
| interface when its name is given. This is mainly needed to add some
| functionality to GNU ifconfig [1] and while looking around came across
| the USAGI FAQ [2], which says that SIOCGIFADDR does not work with IPv6
| although it does for IPv4. Therefore variants of programs like this
| [3] do not work for IPv6. I also found that the variant of ifconfig
| provided by net-tools [4] parses files within /proc/net to read the
| information instead of using ioctl commands. Another option seems to
| be to use SIOCGIFCONF, to read all the available interfaces in a
| linked list [5].

Try list-interfaces.c[1], which will enumerate through all available
interfaces, and prints the corresponding addresses assigned to them.

References:
[1] - http://wahjava.googlepages.com/list-interfaces.c

HTH
- -- 
Ashish Shukla आशीष शुक्ल                      http://wahjava.wordpress.com/
·-- ·- ···· ·--- ·- ···- ·- ·--·-· --· -- ·- ·· ·-·· ·-·-·- -·-· --- --
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.9 (FreeBSD)

iEYEARECAAYFAkhMYloACgkQHy+EEHYuXnSsRQCgs2XUYESkjorNpQIC+FMGRTOB
XngAn3xk1blS6Xb6Q3LxZoQwDAhiFW+e
=CVGM
-----END PGP SIGNATURE-----

_______________________________________________
ilugd mailinglist -- [email protected]
http://frodo.hserus.net/mailman/listinfo/ilugd
Next Event: http://freed.in - February 22-24, 2008
Archives at: http://news.gmane.org/gmane.user-groups.linux.delhi 
http://www.mail-archive.com/[email protected]/

Reply via email to