> > Would someone point me to documentation on how to walk the list of
> > defined network interfaces? Thanks!
>
> The attached example was derived from the appropriate sections of the
> source code for `ifconfig'.
And it has the same problem as ifconfig: it only lists 'up' interfaces, at
least in Linux 2.0.x (and last time I experimented, it's true of 2.1.x
also).
If you want a list of _all_ interfaces, you seem to need to parse
/proc/net/dev. Of course, in 2.1.x, that doesn't include the list of IP
aliases, which is available with SIOCGIFCONF. So if you really want a
complete list, you need to combine the results of both methods. Isn't this
fun?
Avery
-
To unsubscribe from this list: send the line "unsubscribe linux-net" in
the body of a message to majordomo@vger.rutgers.edu