Can I somehow set the 802.11 channel programmatically with the pcap library (or even anything else)?
I’ve written a sniffer and need to sniff on different channels, so I need to set the specific one first. I’ve been searching but I can’t find anything, so I currently set it with the iw tool manually.
Can I somehow set the 802.11 channel programmatically with the pcap library (or even
Share
No, libpcap currently doesn’t have an API to get a list of available 802.11 channels or set the current channel.
I infer from “iw tool” that you’re doing this on Linux; you’ll have to directly use netlink calls to set the channels – see, for example, the code in the
ws80211_utils.cfile in the top-level source directory of Wireshark.