LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Need network adapter information in a c program (https://www.linuxquestions.org/questions/programming-9/need-network-adapter-information-in-a-c-program-584150/)

keanu 09-12-2007 08:54 AM

Need network adapter information in a c program
 
Platform : redhat ent linux 4
i am working on a c program in which i need some details which are listed below:

> network Adapter Description (name of the hardware).
> the link speed or the bandwidth of the connection.
> the current bandwidth under usage.

can anyone tell me where i can get a library that helps in getting these system information. i've already tried libgtop and libpcap but they dont provide the above mentioned information.also i am not allowed to write anything to the disk.

firstfire 09-14-2007 02:39 PM

Hello.

Take a look at `lspci (8)' and `/proc/bus/pci/devices'. Try `lspci -vv'. Maybe the source code of lspci will be helpful.

Hope, this helps.

keanu 09-17-2007 05:19 AM

thankyou, it really helped

apart from "lspci" i also studied source of "ethtool"... it was giving the required output , so i'am going with "ethtool"...


All times are GMT -5. The time now is 04:18 AM.