在基于linux的系统上使用c / c ++获取以太网名称,类,描述供应商,子系统等
问题描述:
使用ioctl接口可以获取各种信息。您如何获得诸如产品名称,类别,供应商名称,子系统名称等额外信息?
Using ioctl interface various info can be fetched. How do you get extra info like product name, class, vendor name, subsystem name etc?
有几种可用的命令行工具,例如:
1 。 lshw -C网络
2. 在装有linux的系统上检测nic和端口
There are couple of command line tools available such as:
1. lshw -C network
2. detecting nic and ports on systems loaded with linux
您可以启动一个进程并获取结果,但是任何获取上述信息的原始c / c ++方法?
You can start a process and get the result but Is there any raw c/c++ method to get above mentioned information?
欢呼声
杀虫剂
答
查看sysfs或procfs,不幸的是,此信息有被更改的习惯,因此不能依赖:(
Look in sysfs or procfs, unfortunately this information has a habit of being changed and so cannot be relied on :(