Open ghost opened 3 years ago
No objections to adding it from me, but you may also have some luck with https://github.com/mdlayher/wifi which uses the nl80211 netlink API rather than more ioctls.
@mdlayher just read your blog post, turns out ioctl wireless API is legacy? Suppose it would be more proper to actually use your netlink implementation in the future? If it is so, i don't actually see a reason anyone would want to develop anything for the legacy API, since iwd
, NetworkManager
, and even wpa_supplicant
(with -Dnl80211
) use the newer one. And yes, your implementation works for me, so i suppose this issue can be closed, if nobody objects.
I'm pretty far removed from the problem space but if all ioctl operations can be performed with nl80211, then yeah I'd recommend going that route instead. I'll leave closing the issue up to you since there's no harm in adding more API to x/sys/unix to mirror the kernel uapis.
Currently
x/sys/unix
hastype Ifreq
and functionIoctlIfreq
, but it would be nice if somebody added wireless support (linux/wireless.h
), since the kernel has a couple of useful functions for that.For example, here is a sample C code to get SSID of a wireless connection:
As far as of now, i don't know a way to reproduce the same thing in Go, apart from using
import "C"
in place. A library functions for that sort of thing would be great.