Regarding interfaces that are up, consider looking at the source of ifconfig (yes I know it's a lame suggestion but it works :).
With interfaces that are down it's a bit more problematic. I'm guessing looking for configuration scripts or aliases for the relevant modules might do the trick (??).
Eli
On Sat, 19 Jul 2003 00:40:31 +0300 (IDT), Matan Ziv-Av <[EMAIL PROTECTED]> wrote:
On Fri, 18 Jul 2003, Itay 'z9u2K' Duvdevani wrote:
I am looking for a way to do these two: 1. Finding out how many eths the system have (eth0, eth1 ... ethn) 2. Knowing the string of each eth as shown in lspci
I'm trying to write an app that will output something like: # ./geteths You have 2 ethernet cards, eth0: Realtek Semiconductor Co., Ltd. RTL-8139/8139C/8139C+ eth1: Realtek Semiconductor Co., Ltd. RTL-8139/8139C/8139C+
In general it is not easy to do, since ethernet devices can be renamed arbitrarily.
But I think of two ways that might work in the vast majority of cases:
1. Search dmesg for lines such as
eth0: VIA VT6102 Rhine-II at 0xe800, 00:50:8d:48:2d:e7, IRQ 11. eth2: NatSemi DP83815 at 0xfd002000, 00:0b:8c:ff:ff:02, IRQ 5.
2. Use a modular kernel, and for every interface, bring it up and see which module has its ref count increased.
-- Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
================================================================= To unsubscribe, send mail to [EMAIL PROTECTED] with the word "unsubscribe" in the message body, e.g., run the command echo unsubscribe | mail [EMAIL PROTECTED]
