gpt4 book ai didi

c++ - C\C++ 中的 Linux 无线 API

转载 作者:行者123 更新时间:2023-11-30 20:12:13 25 4
gpt4 key购买 nike

我正在尝试找到一种正确的方法,如何在自己的代码(c\c++)中重用 wifi 工具(iw)的现有实现。我需要获取有关范围内可用接入点的信息(信号强度、mac 地址等)。我发现了几个使用 ioctl 方法的示例代码(WEXT 和其他),但它会进行被动扫描(并且我在网络中每两分钟才获得一次新信息)[UPDATE1:感谢@fluter,我知道 WEXT 也可以进行主动扫描。]。我发现 iw 进行主动扫描,这就是我所需要的。所以我的问题是:

Is there a way to use iw code in my own app without parsing its source code in chunks, or, maybe, there is an Wireless API for such purpose?

(UPDATE1: with basic code examples to start with.)

Similar question

更新2:我检查了我的任务,发现 AP 信息对我来说还不够,我还需要捕获客户数据。这让我开始嗅探 wifi 数据包,而我发现最好的工具就是 Horst。因此,我现在正在尝试在我的应用程序中重用其代码。

最佳答案

您可能希望从 cfg80211 开始.

cfg80211 替换 Wireless-Extensions建议:

All new Linux wireless drivers should be written targeting either cfg80211 for fullmac devices or mac80211 for softmac devices.

另外,上面写着:

Instead of writing wext ioctls you now write cfg80211 operation callbacks and fill in the wiphy struct to indicate to cfg80211 its device capabilities.

要开始主动扫描,请开始 here

关于c++ - C\C++ 中的 Linux 无线 API,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36773172/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com