Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This patch adds support for frame injection on 802.11n Wi-Fi cards. The patch has been tested with kernel 4.4 (the current stable OpenWRT kernel) and it should work with any recent kernel.
The patch requires support for frame injection by the specific Wi-Fi driver you are using and has been tested extensively only with the ath9k. The patch will not work for VHT rates (11ac) and in general with the ath10k driver.
The radiotap parsing code is from the upstream radiotap project.
A new SetTXRateHT element has been added to allow frame injection at arbitrary MCS (0-15).
The RadiotapEncap/Decap element now supports retry chains, however, the corresponding kernel patch has not yet been merged into upstream. All chains following the first one are thus ignored. If you need the kernel patch adding support for longer retry chains please message me.
Sample script for frame injection:
RatedSource(<9999>, RATE 1, LIMIT 100)
-> EtherEncap(0x06BB, 00:15:6D:84:13:5D, FF:FF:FF:FF:FF:FF)
-> WifiEncap(0x00, 0:0:0:0:0:0)
-> SetTXRateHT(MCS 0, TRIES 1)
-> RadiotapEncap()
-> Print()
-> ToDevice (moni0)
This assumes that moni0 is in monitor mode on a supported driver.
Sample script for rx:
FromDevice(moni0, PROMISC false, OUTBOUND true, SNIFFER false)
->RadiotapDecap()
->FilterPhyErr()
->WifiDupeFilter()
->ToDump(/tmp/tmp.pcap, ENCAP 802_11, SNAPLEN 0)