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. -- Matan Ziv-Av. [EMAIL PROTECTED] ================================================================= 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]
