在基于linux的系统上使用c / c ++获取以太网名称,类,描述供应商,子系统等 [英] get ethernet name, class, description vendor, subsystem, etc using c/c++ on linux based systems

查看:105
本文介绍了在基于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 :(

这篇关于在基于linux的系统上使用c / c ++获取以太网名称,类,描述供应商,子系统等的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆