关于inject_frame函数的替代代码可以参考
https://github.com/MinimumLaw/80211_raw
1、查看wifibroadcast的Makefile
发现依赖 _LDFLAGS := $(LDFLAGS) -lrt -lpcap -lsodium
2、
如果是ubuntu,只需要执行
sudo apt-get install libpcap-dev
sudo apt-get install -y libsodium-dev
在make即可。
3、如果是开发板arm平台,需要进行交叉编译,移植libsodium
libsodium 简介
The Sodium crypto library (libsodium)
Sodium is a new, easy-to-use software library for encryption, decryption, signatures, password hashing and more.
It is a portable, cross-compilable, installable, packageable fork of NaCl, with a compatible API,
and an extended API to improve usability even further.
Its goal is to provide all of the core operations needed to build higher-level cryptographic tools.
Sodium supports a variety of compilers and operating systems, including Windows
(with MingW or Visual Studio, x86 and x64), iOS and Android.
Sodium 加密库
Sodium 是一个全新而且易用的加密库,用于加密、解密、签名和生成密码哈希等等。 它是一个可移植的、跨编译器支持、可安装的,基于 NaCI 开发,提供了一个兼容 API 和一个提高更高可用性的扩展 API。 它的目标是提供构建一个更高级的加密工具所需要的所有核心操作。 Sodium 支持各种各样的编译器和操作系统,包括 Windows( 如 MingW 或者 Visual Studio, x86 和 x64),iOS 和 Android。
参考
http://jaminzhang.github.io/programming/libsodium-introduction-and-installation/
wget -N --no-check-certificate https://download.libsodium.org/libsodium/releases/libsodium-1.0.18.tar.gz
tar xvf libsodium-1.0.18.tar.gz
cd libsodium-1.0.18
此种方式可以生成so动态库
./configure --prefix=$(pwd)/__install --enable-shared --enable-static --host=arm-linux
make && make check
make install
可以不执行make check
make install后会安装在__install 目录下。
4、进行copy到工具链中进行编译
sudo cp -rf __install/include/* /opt/fsl-imxXXX/sysroots/aarch64-poky-linux/usr/include/
sudo cp -rf __install/lib/* /opt/fsl-imxXXX/sysroots/aarch64-poky-linux/usr/lib/
5、下载wifibroadcast
https://github.com/svpcom/wifibroadcast.git
使用最新代码21.03分支。
直接进行make即可,会编译生成 wfb_rx wfb_tx文件,此时wifibroadcast编译ok
6、wifibroadcast需要与wifi同时使用